Artemis CLI
Command-line interface for the Artemis AI code optimization platform.
The Artemis CLI enables automated code analysis, optimization, and validation through AI agents — directly from your terminal. It supports the full Artemis workflow: importing repositories, selecting code to optimize, generating AI-powered versions, validating them on your runner, and shipping the results as pull requests.
The CLI is ideal for scripting, CI/CD pipelines, and power users who prefer terminal workflows over the web UI.
Install the Artemis CLI
Prerequisites
- macOS, Linux, or Windows
- A bash shell on macOS/Linux, or PowerShell 5.0+ on Windows
- Internet connection for download and API access
- An Artemis API key (PAT) — generate one from the Artemis web UI
Quickstart
1. Download and run the installer
The commands below download the installer script and run it. The installer fetches the right artemis binary for your OS and architecture, places it on your PATH, and configures the environment endpoints for you. After the installer finishes, you can run artemis from any terminal.
Production
curl -L --anyauth -u "Artemis_User:Artemis_Custom_Runner_2025" \
"https://files.artemis.turintech.ai/artemis-cli/prod/artemis-cli-installer.sh" \
-o installer.sh && chmod +x installer.sh && ./installer.sh --env prod
Staging
curl -L --anyauth -u "Artemis_User:Artemis_Custom_Runner_2025" \
"https://files.artemis.turintech.ai/artemis-cli/stg/artemis-cli-installer.sh" \
-o installer.sh && chmod +x installer.sh && ./installer.sh --env stg
Development
curl -L --anyauth -u "Artemis_User:Artemis_Custom_Runner_2025" \
"https://files.artemis.turintech.ai/artemis-cli/dev/artemis-cli-installer.sh" \
-o installer.sh && chmod +x installer.sh && ./installer.sh --env dev
On Premise
curl -L --anyauth -u "Artemis_User:Artemis_Custom_Runner_2025" \
"https://files.artemis.turintech.ai/artemis-cli/prod/artemis-cli-installer.sh" \
-o installer.sh && chmod +x installer.sh && ./installer.sh --env prod \
--base-url https://your-custom.artemis.turintech.ai
Alternative: Download the binary directly
If you'd rather skip the installer and manage the binary yourself (e.g. for CI images, containers, or air-gapped setups), download the binary for your platform directly. You'll need to put it on your PATH and configure endpoints manually.
Linux (amd64)
curl -L --digest -u "Artemis_User:Artemis_Custom_Runner_2025" \
"https://files.artemis.turintech.ai/artemis-cli/prod/artemis-cli-linux-amd64" \
-o artemis && chmod +x artemis
Swap artemis-cli-linux-amd64 for artemis-cli-darwin-amd64, artemis-cli-darwin-arm64, or artemis-cli-windows-amd64.exe as needed, and swap prod for stg or dev for non-production builds.
When you download the binary this way, the installer hasn't run — so you need to point the CLI at the Artemis services yourself before it can do anything. Set the endpoint URLs that match your environment (the example below is for an on-prem deployment at artemis.turintech.ai):
./artemis config set USER_MGMT_URL http://artemis.turintech.ai/turintech-users-api
./artemis config set AGENT_MGMT_URL http://artemis.turintech.ai/turintech-agent-management
./artemis config set FALCON_URL http://artemis.turintech.ai/turintech-falcon
./artemis config set QUEST_URL http://artemis.turintech.ai/turintech-quest-api
./artemis config set VISION_URL http://artemis.turintech.ai/turintech-vision-api
Replace the base host with your own deployment (e.g. staging.artemis.turintech.ai, dev.artemis.turintech.ai, or your on-prem domain). Then continue to the API key step below.
2. Configure your API key
artemis config set ARTEMIS_API_KEY <your-api-key>
3. Verify installation
artemis status
Feature Overview
The Artemis CLI exposes the full Artemis platform through structured command groups. Each group covers one stage of the optimization workflow.
| Command Group | What It Does |
|---|---|
project | Import and manage Git repositories |
key | Manage Git authentication keys (PATs) |
target | Select code constructs (functions, methods, classes) for optimization |
target version | Generate, validate, score, and ship AI-optimized versions |
validation | Run compile, test, and benchmark validation on generated code |
optimisation | Find the best combination of versions through automated benchmarking |
task | Create and execute AI coding tasks (single work items) |
plan | Break down complex features into structured tasks with AI |
chat | Interactive AI conversations about your codebase |
scan | Run security audits and code quality scans |
model | View available LLM models for code generation and analysis |
tui | Launch the interactive terminal dashboard |
config | Manage CLI configuration |
status | Show configuration and connectivity status |
version | Print CLI version information |
Run artemis <command> --help for full details on any group.
Typical Workflow
A complete end-to-end optimization run looks like this:
# 1. SETUP — verify your connection
artemis config
artemis status
# 2. ADD A GIT KEY — register your Personal Access Token
artemis key add --name "github-work" --provider github --token <PAT>
# 3. IMPORT A PROJECT — clone a repo into Artemis
artemis project import \
--git-url https://github.com/your-org/your-repo.git \
--key-id <key-id>
# 4. ADD TARGETS — select code to optimize
artemis target add --project <project-id> --files src/main.go,src/utils.go
# or let AI find them:
artemis target add --project <project-id> --prompt "find performance bottlenecks"
# 5. GENERATE VERSIONS — create AI-optimized alternatives
artemis target version create --project <project-id> --target <target-id> --method llm
# 6. VALIDATE — make sure they compile and pass tests
artemis validation run --project <project-id> --worker <runner> --types compile,test
# 7. SCORE — evaluate quality
artemis target version score run --project <project-id>
artemis target version score compare run --project <project-id>
# 8. OPTIMIZE — find the best combination via benchmarking
artemis optimisation create --project <project-id> --all-enabled --runner <runner>
artemis optimisation best --id <opt-id>
# 9. SHIP — open a pull request with the best version
artemis optimisation pr --id <opt-id> --best --title "Performance improvements"
Code Optimization Features
Targets and Versions
A target is a code construct (function, method, or class) selected for optimization. Each target can have multiple versions (specs) — the original plus AI-generated alternatives.
Targets can be added two ways:
- By file path (
--files src/main.go) — Artemis extracts constructs from the files you provide. - By AI prompt (
--prompt "find bottlenecks") — an AI agent analyzes your codebase and identifies relevant targets.
Version Generation Methods
When creating versions, the CLI supports three methods with different speed/quality tradeoffs:
| Method | Best For | Time per Target | Cost | Notes |
|---|---|---|---|---|
llm | Quick experiments, simple optimizations | ~30 seconds | Low | Zero-shot direct LLM call |
agent | Complex refactoring, multi-file understanding | 1–5 minutes | Medium | AI agent with reasoning and context awareness |
ga | Performance optimization with validation | 10–60 minutes | High | Artemis Intelligence — genetic algorithm with multiple generations and benchmark-driven selection. Requires a runner. |
Example:
# Fast LLM optimization
artemis target version create --project <id> --target <id> --method llm
# Thorough agent-based optimization
artemis target version create --project <id> --target <id> --method agent
# Artemis Intelligence (genetic algorithm)
artemis target version create --project <id> --target <id> \
--method ga --worker my-runner --population 5 --generations 4
# Run validation alongside GA
artemis target version create --project <id> --target <id> \
--method ga --worker my-runner --compile --test --benchmark
Validation
Validation executes your project's commands against generated versions to verify they work. Three types are supported:
- compile — Runs the build command (e.g.
go build,npm run build) to catch syntax/type errors - test — Runs your test suite (e.g.
go test,pytest,npm test) to catch functional regressions - benchmark — Runs performance benchmarks to measure optimization impact
Validation requires a registered Artemis Runner.
# Validate all targets, all types
artemis validation run --project <id> --worker my-runner
# Compile-only (fast feedback)
artemis validation run --project <id> --worker my-runner --types compile
# Compile and test (skip benchmark)
artemis validation run --project <id> --worker my-runner --types compile,test
# Validate specific specs
artemis validation run --project <id> --target <id> \
--specs <spec1>,<spec2> --worker my-runner
# Check run status
artemis validation status --run <process-id>
# View results
artemis validation results --project <id> --target <id>
Optimisation Runs
An optimisation tests combinations of versions across multiple targets to find the best-performing set, measured against your project's real benchmarks.
# Test every enabled version
artemis optimisation create \
--project <id> --all-enabled --runner my-runner
# Test specific targets and specs
artemis optimisation create \
--project <id> \
--target <target1-id>:<spec1>,<spec2> \
--target <target2-id>:<spec3>,<spec4> \
--runner my-runner
# Check progress
artemis optimisation status --id <opt-id>
# View best solution
artemis optimisation best --id <opt-id>
# Ship as PR
artemis optimisation pr --id <opt-id> --best --title "Perf improvements"
AI Coding Features
Tasks
A task is a single work item describing code changes for an AI agent to implement. Tasks can be created standalone or generated from a plan.
# Create and auto-start a task
artemis task create \
--project <id> \
--prompt "Add input validation to user registration" \
--auto-start
# List tasks by status
artemis task list --project <id> --status done
# Start an existing task
artemis task start <task-id>
# Use a specific model
artemis task start <task-id> --model claude-sonnet-4-5-20250929
# Create PR from completed task
artemis task pr <task-id> --title "feat: add input validation"
# Or open as draft
artemis task pr <task-id> --title "WIP: validation" --draft
Task statuses: todo, in_progress, done, failed, cancelled.
Plans
A plan breaks down a large feature into ordered tasks with AI assistance. The agent asks clarifying questions, analyzes your code, and produces a structured implementation roadmap.
# Interactive planning (AI asks questions)
artemis plan create \
--project <id> \
--prompt "implement user authentication with OAuth2"
# Skip Q&A for simple, well-defined work
artemis plan create \
--project <id> \
--prompt "add unit tests for user service" \
--skip-interaction
# Inspect a plan
artemis plan get <plan-id>
# List plans
artemis plan list --project <id>
After review, plans can be converted to tasks (via the UI) and executed with artemis task start.
Chats
Chats let you have AI-powered conversations about your codebase — for understanding, debugging, or architectural questions. Chats do not produce code changes by default, but a sync-mode chat can offer to spin up a task or plan from a suggestion.
# Async chat (runs in background)
artemis chat create \
--project <id> \
--message "Explain the authentication flow"
# Sync chat with real-time streaming
artemis chat create \
--project <id> \
--message "Show me the vulnerabilities" \
--sync
# Use a specific model
artemis chat create \
--project <id> \
--message "Help me optimize this function" \
--model claude-sonnet-4-5-20250929
# Manage chats
artemis chat list --project <id>
artemis chat get <chat-id>
artemis chat cancel <chat-id>
Chat vs Task vs Plan:
- Chat — Q&A about your code, no code changes
- Task — Single coding work item, produces code changes
- Plan — Feature breakdown that produces multiple tasks
Scanning and Audits
The scan command runs AI-powered security and quality audits across your codebase. Findings include severity, location, and remediation suggestions.
Scan categories:
- Security — SQL injection, XSS, auth issues, sensitive data exposure, insecure dependencies
- Code Quality — complexity, maintainability, dead code, duplication
- Performance — inefficient algorithms, memory leaks, N+1 queries
- Best Practices — language conventions, framework idioms, documentation coverage
Severity levels: critical, high, medium, low, info.
# Run a full scan
artemis scan create --project <id>
# Scan with specific rule categories
artemis scan create --project <id> --rules security,performance
# Review findings
artemis scan issues <scan-id> --severity critical,high
# Manage scan rules
artemis scan rules list --project <id>
artemis scan rules enable <rule-id> --project <id>
artemis scan rules disable <rule-id> --project <id>
Scans pair well with tasks: triage findings, then artemis task create --prompt "Fix <issue>" to remediate.
Projects and Git Keys
Supported Git Providers
- GitHub (
github) - GitLab (
gitlab) - Bitbucket (
bitbucket) - Azure DevOps (
azure)
Managing Keys
Artemis needs a Personal Access Token to clone private repos, create branches, and open PRs. Keys are encrypted at rest and referenced by ID.
# Register a GitHub PAT
artemis key add \
--name "github-work" \
--provider github \
--token ghp_xxxxxxxxxxxxxxxxxxxx
# List keys
artemis key list
# Delete a key (does not revoke the underlying token)
artemis key delete <key-id>
Required token scopes:
| Provider | Token Type | Scopes |
|---|---|---|
| GitHub | PAT / Fine-grained PAT | repo |
| GitLab | PAT | api, read_repository, write_repository |
| Bitbucket | App Password | Repositories read/write |
| Azure DevOps | PAT | Code read/write |
Importing Projects
# Basic import (auto-sync enabled by default)
artemis project import \
--git-url https://github.com/your-org/repo.git \
--key-id <key-id>
# Custom name and branch
artemis project import \
--git-url https://github.com/your-org/repo.git \
--key-id <key-id> \
--name "My API Service" \
--branch develop
# Enable auto-sync on an existing project (required for tasks/PRs)
artemis project sync <project-id>
# Search and filter
artemis project list --search "my-api"
artemis project list --language python
Auto-sync mirrors your repository to Artemis's internal Gitea, which is required for task execution and PR creation.
Models
The CLI supports models from multiple providers. Use --model <id> (single) or --models <id1>,<id2> (multi) on commands that generate code.
Model categories:
- Coding — used by
target version createandtask start - Planning — used by
plan createandchat create - Scoring — used by
target version score run - Utility — internal processing
# List all available models
artemis model list
# Show models grouped by category
artemis model groups
artemis model groups --task chat
# Use a specific model for version generation
artemis target version create \
--project <id> --target <id> \
--method llm --model claude-sonnet-4-5-20250929
# Generate one version per model (creates multiple versions)
artemis target version create \
--project <id> --target <id> \
--models gpt-4o,claude-sonnet-4-5-20250929
If no model is specified, Artemis uses configured defaults for each task type.
Interactive TUI
For a richer terminal experience, launch the dashboard:
artemis tui dashboard
The TUI provides interactive project navigation, task monitoring, and chat — built on the Bubble Tea framework.
Configuration
The CLI loads configuration from environment variables and .env files. Priority: environment variables > .env file > defaults.
Common Commands
# Show current configuration
artemis config
artemis config show
# Set a value
artemis config set ARTEMIS_API_KEY <your-api-key>
# Interactive setup
artemis config setup
# Edit config file
artemis config edit
# Set up a custom environment (e.g. on-prem)
artemis config env
Environment Variables
Required
| Variable | Description |
|---|---|
ARTEMIS_API_KEY | Your Artemis API key (PAT token) |
API Endpoints (set automatically by the installer; override for custom deployments)
| Variable | Description |
|---|---|
USER_MGMT_URL | User management service URL |
AGENT_MGMT_URL | Agent management service URL |
FALCON_URL | Falcon execution service URL |
QUEST_URL | Quest orchestration service URL |
VISION_URL | Vision (LLM models) service URL |
Optional Preferences
| Variable | Default | Description |
|---|---|---|
ARTEMIS_DEBUG | false | Enable verbose debug output |
ARTEMIS_OUTPUT_FORMAT | text | Output format: text, json, or yaml |
ARTEMIS_TIMEOUT | 30s | Request timeout (e.g. 30s, 1m) |
ARTEMIS_RETRY_ATTEMPTS | 3 | Number of retry attempts |
ARTEMIS_RETRY_DELAY | 1s | Delay between retries |
Global Flags
Available on every command:
| Flag | Description |
|---|---|
--debug | Enable verbose debug output |
--config <path> | Path to a custom config file (default: .env in current directory) |
--output-format <fmt> | Output format: text, json, yaml |
-h, --help | Show help for the command |
Getting Help
Every command and subcommand has its own help text with examples:
artemis --help
artemis target --help
artemis target version create --help
For runner setup, see Artemis Custom Runner. For genetic-algorithm-based optimization details, see Artemis Intelligence.