Overview

Complete guide to using the CiviraAI CLI for script testing, deployment, and management

The CiviraAI CLI is a command-line tool that enables you to test, execute, and manage Accela EMSE scripts locally. This guide covers all CLI features, commands, and best practices.

What is the CiviraAI CLI?

The CiviraAI CLI provides:

  • Script Testing: Test scripts safely with automatic rollback
  • Parameter Management: Save and reuse script parameters
  • Event Handling: Execute event scripts (ASA, WTUA, IRSA)
  • Batch Processing: Run batch scripts with parameters
  • SQL Queries: Execute SQL queries against your Accela database
  • Safe Testing: Scripts run but changes are automatically rolled back in test mode
  • Multiple Script Types: Solution scripts, event scripts, batch scripts, and SQL queries
  • Parameter Persistence: Automatically saves parameters for reuse across sessions

Authentication with CiviraAI

First, authenticate with CiviraAI and check your connection:

# Login to CiviraAI
accli login

# Check your authentication status
accli status

Headless / CI Authentication

On desktops the CLI stores your token in the OS keychain. In CI or on a headless server, provide the token via environment variables instead — the CLI reads from the environment and never touches the keychain (no GUI unlock prompt, no hang):

export ACCELA_CLI_TOKEN='<your CiviraAI JWT>'
accli status
accli test sql queries/MyQuery.sql --json
VariablePurpose
ACCELA_CLI_TOKENJWT auth token — its presence enables headless mode
ACCELA_CLI_REFRESH_TOKENRefresh token (optional)
ACCELA_CLI_TOKEN_EXPIRESISO 8601 expiry (optional)
ACCELA_CLI_NO_KEYCHAINForce keychain-skip without an env token
CICI=true also forces keychain-skip

Pair this with --json and the process exit code (0 success, non-zero failure) to script the CLI reliably — see CLI Commands Reference.

Initializing a Project

Each project/repository needs to be initialized and linked to an Accela environment. You can easily change the agency and environment you're linked to:

# Initialize a new project
accli init

# Link to an agency environment
accli link

Executing a Generic Script Test

Start with a simple script test without parameters to see the CLI in action:

# Test a script (rollback mode - safe testing)
accli test script Scripts/MyScript.js

The CLI will show script execution output, debug messages, and any errors directly in your terminal.

Execute a Script Test Using Parameters

Interactive Mode

When you run a script without parameters, the CLI will ask:

  1. Run without parameters? - Execute the script as-is
  2. Use existing parameter set? - Select from saved parameters
  3. Create new parameter set? - Enter new parameters interactively

Interactive mode creates reusable parameter sets that are saved in CiviraAI for future use.

Non-Interactive Mode

For automation and scripting, use the --param flag:

# Test with parameters (not saved)
accli test script Scripts/MyScript.js \
  --param "recordId=PR2024-001" \
  --param "status=Complete" \
  --param "department=Building"

Viewing Script Execution Logs in CiviraAI

After running scripts, you can view detailed execution logs, performance metrics, and debugging information in the CiviraAI web interface. This provides a comprehensive view of your script execution history and helps with troubleshooting.

VS Code/Cursor Add-ons

VSCode/Cursor Extension

Use the CiviraAI VSCode/Cursor extension for execution context menus and enhanced development experience.

Installation:

# Install VSCode/Cursor extension and Cursor rules
accli install-tools

Usage:

  • Right-click on script files to access execution context menus

Installing Cursor Rules

Install Cursor rules for better AI assistance when working with Accela scripts.

Installation:

# Install Cursor rules via CLI
accli install-tools

Checking for CLI Updates

# Check for CLI updates
accli update

# Install development tools
accli install-tools

Common Issues

  • Authentication errors: Run accli login -r for a quick refresh of your CiviraAI authentication token
  • Connection issues: Run accli status to check your setup
  • Script errors: Check execution logs in the CiviraAI web interface

Next Steps

Ready to dive deeper? Explore these essential topics: