CLI Commands Reference
Complete reference for all CiviraAI CLI commands including script testing, deployment, and management
This comprehensive reference covers all available CiviraAI CLI commands for testing scripts, managing projects, and working with your Accela environments.
Authentication Commands
accli login
Authenticate with CiviraAI.
accli login
What it does:
- Prompts for email and password
- Stores authentication token locally
- Verifies connection to CiviraAI
Example:
$ accli login Email: user@example.com Password: ******** ✓ Successfully authenticated with CiviraAI
accli logout
Log out from CiviraAI.
accli logout
What it does:
- Removes stored authentication token
- Clears local credentials
- Requires re-authentication for future commands
accli status
Display current authentication and environment status.
accli status
What it shows:
- Authenticated user information
- Linked agency and environment
- Connection status
- CLI version
Example output:
✓ Authenticated as: user@example.com ✓ Agency: springfield-city ✓ Environment: production ✓ Connection: Active ✓ CLI Version: 1.2.3
Project Management Commands
accli init
Initialize a new project with CiviraAI CLI configuration.
accli init
What it creates:
.accela-cli/directory- Configuration files
- VS Code integration (optional)
- Project structure
accli link
Link project to an agency environment.
accli link
Interactive prompts:
- Select agency from available agencies
- Select environment from available environments
- Confirm configuration
- Create local config file
Example:
$ accli link Available agencies: 1. Springfield City (springfield-city) 2. Metro County (metro-county) Select agency: 1 Available environments: 1. Civcon (dev) 2. Testing (test) Select environment: 2 ✓ Linked to Springfield City - Testing environment
accli config show
Display current configuration.
accli config show
Shows:
- Agency information
- Environment details
- Project settings
- Authentication status
Script Testing Commands
accli test script
Execute a generic/on-demand script in rollback mode (safe testing).
# Basic usage accli test script Scripts/MyScript.js # With parameters accli test script Scripts/MyScript.js --param "recordId=PR2024-001" --param "status=Complete" # With commit (applies changes to database) accli test script Scripts/MyScript.js --commit # Don't save to script library accli test script Scripts/MyScript.js --no-save
Options:
--commit- Commit changes instead of rolling back--param key=value- Set script parameters (repeatable)--no-save- Don't save script to CiviraAI library--record <id>- Set record context (e.g., "PR2024-001")
Interactive Parameter Mode: When you run without parameters, the CLI will ask:
- Run without parameters? - Execute the script as-is
- Use existing parameter set? - Select from saved parameters
- Create new parameter set? - Enter new parameters interactively
accli test event
Execute an event script (ASA, WTUA, IRSA, etc.).
# ASA (ApplicationSubmitAfter) accli test event asa Scripts/Event/ASA_Handler.js --record "PR2024-001" # WTUA (WorkflowTaskUpdateAfter) accli test event wtua Scripts/Event/WTUA_Handler.js \ --record "PR2024-001" \ --task "Review" \ --status "Complete" # IRSA (InspectionResultSubmitAfter) accli test event irsa Scripts/Event/IRSA_Handler.js \ --record "PR2024-001" \ --inspection "Electrical"
Event-specific options:
--record <id>- Required: Record ID (e.g., permit, license number)--task <name>- For WTUA: workflow task name--status <status>- For WTUA: task status--inspection <type>- For IRSA: inspection type
accli test batch
Execute a batch script.
# Basic batch script accli test batch Scripts/Batch/DailyReport.js # With parameters accli test batch Scripts/Batch/DailyReport.js \ --param "StartDate=2024-01-01" \ --param "EndDate=2024-01-31" \ --param "Department=Building" # With commit accli test batch Scripts/Batch/DailyReport.js --commit
Options:
--param key=value- Set batch parameters (repeatable)--commit- Commit changes (batch scripts typically need this)
accli test sql
Execute a SQL query file. Defaults to SELECT (safe, rolls back); UPDATE/DELETE require an explicit flag.
# Basic query (auto-limited to TOP 1000) accli test sql queries/MyQuery.sql # Remove TOP 1000 limit (use with caution) accli test sql queries/MyQuery.sql --no-limit # Show full, untruncated cell values (default view clips to a 20-char preview) accli test sql queries/MyQuery.sql -v # Machine-readable JSON to stdout (for scripts/automation) accli test sql queries/MyQuery.sql --json # Write the full JSON result to a file accli test sql queries/MyQuery.sql --out result.json # UPDATE / DELETE (explicit; asks for confirmation with --commit) accli test sql queries/Update.sql --update accli test sql queries/Delete.sql --delete
Options:
--select/--update/--delete- Query type (defaults to--select)--no-limit- Remove the automatic TOP 1000 safety limit-v, --verbose- Print every row with full, untruncated values--json- Emit one clean JSON envelope to stdout (human chatter goes to stderr). Full row set, never clipped.--out <file>- Write the full JSON envelope to a file (composes with--json)-c, --commit/-y, --yes- Commit changes (with confirmation, or skip it)
Safety Note: SELECT queries default to a TOP 1000 limit to prevent accidental large data pulls.
JSON output and exit codes
With --json, the CLI prints a single stable envelope:
{
"success": true,
"exit_code": 0,
"rowCount": 1,
"columns": ["CNT"],
"rows": [ { "CNT": "5191" } ],
"truncated": false,
"transaction": { "committed": false },
"duration_ms": 5485
}
| Field | Meaning |
|---|---|
success | true only if the query executed and returned no error |
exit_code | mirrors the process exit code (0 success, 1 failure) |
rowCount | server-reported row count |
columns | column names in order (on success) |
rows | full result rows — never clipped (on success) |
truncated | true only if fewer rows were returned than counted |
transaction | transaction outcome (e.g. { "committed": false } in test/rollback mode) |
duration_ms | execution time in milliseconds |
error | failure message (on failure; rows: [], rowCount: 0) |
Exit codes: 0 = success, non-zero = failure — including SQL-level errors. A query against a missing table or with a SQL error now exits 1 with success: false and the message in error, even though Accela's engine reports the underlying execution as "successful". Automation can branch on the exit code or on success.
accli test sql queries/Bad.sql --json ; echo "exit=$?"
# { "success": false, "exit_code": 1, "error": "... Invalid object name 'FOO'.", "rowCount": 0, "rows": [] }
# exit=1
The same --json, --out, -v, and exit-code behavior applies to accli run sql (which commits; pass --select/--update/--delete explicitly).
Commit Execution Commands
accli run script|event|batch|sql
Shortcut for test --commit. Use for commit executions.
# Run script with commit accli run script Scripts/MyScript.js # Run batch script accli run batch Scripts/Batch/DailyReport.js --param "Date=2024-01-15" # Run event script accli run event asa Scripts/Event/ASA_Handler.js --record "PR2024-001" # Run a SQL query (explicit query type; supports --json / --out / -v) accli run sql queries/MyQuery.sql --select --json
Warning: run commands commit changes to your database. Always test with accli test first!
Pulling Scripts
accli pull script
Pull a script from the linked Accela environment down to a local .js file. Writes the actual script source, not the Accela script identifier.
# Pull to the current directory accli pull script SmokeTestCLI # Pull into a directory, overwriting if present accli pull script SmokeTestCLI --out ./pulled --force
Options:
--out <dir>- Output directory (defaults to the current directory)-f, --force- Overwrite the local file if it already exists
Script Deployment Commands
accli deploy script
Deploy a JavaScript script to your Accela environment.
# Basic deployment accli deploy script Scripts/MyScript.js # Skip confirmation prompt accli deploy script Scripts/MyScript.js --yes # Deploy with custom Accela script name accli deploy script Scripts/MyScript.js --name "MY_CUSTOM_SCRIPT" # Non-interactive mode (requires --yes) accli deploy script Scripts/MyScript.js --yes --non-interactive
Options:
--name <name>- Accela script name (defaults to filename without extension)-y, --yes- Skip confirmation prompt--non-interactive- Non-interactive mode (fails if confirmation needed without --yes)
What it does:
- Validates project is linked to an agency environment
- Checks CiviraAI and Accela authentication
- Reads the script file content
- Uploads the script to your Accela environment
- Always overwrites existing scripts with the same name
- Displays deployment results and execution logs
Prerequisites:
- Must be authenticated with CiviraAI (
accli login) - Project must be linked to an agency (
accli link) - Must have Accela authentication for the target environment
Example workflow:
# Test the script first accli test script Scripts/MyScript.js --param "recordId=TEST-001" # Deploy after successful testing accli deploy script Scripts/MyScript.js --name "PERMIT_VALIDATION_SCRIPT"
Safety features:
- Requires confirmation before deployment (unless
--yesis used) - Validates authentication before proceeding
- Shows deployment details (environment, agency, script name)
- Displays deployment logs and execution results
Warning: Deployment updates the live script in your Accela environment and always overwrites existing scripts. Always test thoroughly before deploying!
Deploy multiple scripts in sequence
# Deploy all scripts in a directory for script in Scripts/Solution/*.js; do accli deploy script "$script" --yes done
Utility Commands
accli hello
Test connectivity with a simple "hello world" script.
accli hello
What it does:
- Runs a simple test script
- Verifies end-to-end connectivity
- Checks authentication and environment connection
accli update
Check for CLI updates.
accli update
What it does:
- Checks npm registry for newer versions
- Compares with current version
- Prompts to upgrade if available
accli install-tools
Install additional development tools.
# Install all tools accli install-tools # Interactive installation accli install-tools --interactive
What it installs:
- VS Code/Cursor extension
- Cursor AI rules
- Development guides
- Project templates
Parameter Management
How Parameter Persistence Works
- When you run a script with
--paramoptions, the CLI saves them - Next time you run the same script, the CLI:
- Pre-fills saved parameters
- Prompts for any missing parameters
- Lets you override parameters with new
--paramvalues
Interactive Parameter Mode
When you run a script without parameters, the CLI will ask:
- Run without parameters? - Execute the script as-is
- Use existing parameter set? - Select from saved parameters
- Create new parameter set? - Enter new parameters interactively
Non-Interactive Mode
For automation and scripting, use the --param flag:
accli test script Scripts/MyScript.js \ --param "recordId=PR2024-001" \ --param "status=Complete" \ --param "department=Building"
Example Workflow
First execution:
accli test batch Scripts/Batch/Report.js \ --param "StartDate=2024-01-01" \ --param "EndDate=2024-01-31"
Parameters are saved. Next execution:
# CLI remembers previous parameters accli test batch Scripts/Batch/Report.js # Or override specific parameters accli test batch Scripts/Batch/Report.js --param "EndDate=2024-02-29"
Viewing Saved Parameters
Saved parameters are stored in:
.accela-cli/saved-params/<script-name>.json
Getting Help
Command Help
# Get help for a specific command accli <command> --help # Get help for all commands accli --help
Common Issues
Authentication errors:
- Run
accli logoutthenaccli login - Check your email and password
- Verify your CiviraAI account is active
Connection issues:
- Run
accli statusto check your setup - Verify your environment is properly configured
- Check that the wrapper script is installed in Accela
Script execution errors:
- Ensure the wrapper script is installed in Accela
- Check that the script name is exactly
RADISH_ACCELA_CLI - Verify your Accela user has script execution permissions