Reference&Support
CLI Command Reference
Written By: Emily Thompson
Last Updated on June 19, 2023
Introduction
The codi
CLI provides local access to CODI agents via your terminal or the web demo environment. Use these commands to scaffold projects, run AI-driven audits, generate tests, deploy to Solana clusters, and manage configuration.
Global Flags & Environment Variables
--help
,-h
: Show help for any command.--verbose
,-v
: Enable detailed logging output.--format <json|markdown>
: Specify output format for audit and test reports.ENV
CODI_API_URL
: Override default web API endpoint.ENV
SOLANA_WALLET
: Path or base58 key for Solana wallet.
Command: init
Description: Scaffold a new Anchor project.
Flags:
--template <anchor|spl-token|custom>
--force
: Overwrite existing directory.
Output: Project folder structure,
Anchor.toml
, boilerplate code.
Command: audit
Description: Run static and AI-driven security checks.
Flags:
--format
: Output format (default: markdown).--fix
: Apply auto-fixable suggestions to code.
Exit Codes: 0 = no vulnerabilities above threshold; 1 = findings; 2 = error.
Command: test
Description: Generate and execute unit/integration tests.
Flags:
--coverage
: Output coverage metrics.--filter
: Run tests matching glob pattern.
Output: Test results summary, detailed logs.
Command: deploy
Description: Compile and publish program to Solana cluster.
Flags:
--network
: Target cluster (default: devnet).--rollback
: Revert to last successful deploy snapshot.
Output: Program ID, transaction signature.
Advanced Commands
config
Description: Manage runtime settings in
codi.toml
or remote config.Usage:
set
: Update a key (e.g.,deploy.retries
).get
: Retrieve current value.
rollback
Description: Roll back to last snapshot for the specified environment.
Aliases: Equivalent to
deploy --rollback
.
version
Description: Print CLI version and linked Agents versions.
Usage: Confirm compatibility between CLI and server.
Conclusion
Use this reference to navigate the codi
CLI effectively. Combine commands with flags and environment variables to customize agent behavior, integrate with CI/CD, and manage on-chain deployments.
Related to Reference&Support