Reference&Support

CLI Command Reference

Full reference for the codi CLI: global flags, environment variables, and detailed usage for init, audit, test, deploy, plus advanced commands like config, rollback, and version.

Full reference for the codi CLI: global flags, environment variables, and detailed usage for init, audit, test, deploy, plus advanced commands like config, rollback, and version.

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

codi init <project-name> [--template <name>]
  • 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

codi audit [--format <json|markdown>] [--fix]
  • 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

codi test [--coverage] [--filter <pattern>]
  • 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

codi deploy [--network <devnet|testnet|mainnet>] [--rollback]
  • 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

codi config set|get --key <path> [--value <val>] [--env <env>]
  • Description: Manage runtime settings in codi.toml or remote config.

  • Usage:

    • set: Update a key (e.g., deploy.retries).

    • get: Retrieve current value.

rollback

codi rollback [--network <env>]
  • 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.

© 2025 CODI all rights reserved | Created with ♥️

© 2025 CODI all rights reserved | Created with ♥️

© 2025 CODI all rights reserved | Created with ♥️