Skip to main content

devsec — DevArchAI CLI

Production command-line client for DevArchAI. The CLI authenticates against the hosted SaaS backend, registers repositories, starts scans, streams real-time progress, and returns findings. It does not run a local scanning engine.

Install

Requires Python 3.11+.

pip install devsec

Or install from this repository while developing:

pip install -e ./cli

Verify:

devsec --version
devsec --help

Quick start

# Log in (opens https://www.devarchai.xyz/ settings)
devsec auth login

# Scan the current git repository (uses origin/upstream remote)
cd your-repo
devsec scan

# Scan a specific repository URL
devsec scan --repo https://github.com/org/repo

# CI / scripting
devsec scan --json --quiet --no-color --fail-on high

Production API and frontend URLs are the defaults — no local setup required:

Setting Default
API https://backend.devarchai.xyz
Web app https://www.devarchai.xyz

Override for local development:

export DEVSEC_API_URL=http://localhost:8000
export DEVSEC_FRONTEND_URL=http://localhost:5174
# or
devsec config set api-url http://localhost:8000

Authentication

devsec auth login          # paste API key from Settings → Security
devsec auth status         # show current user
devsec auth logout         # remove local credential
devsec auth logout --revoke  # also revoke key on server

API keys (sk-...) are stored in the OS keyring (or ~/.config/devsec/credentials.json with 0600 permissions as fallback). Keys are never logged or written to config.toml.

For CI, set DEVSEC_API_KEY in the environment.

Projects

Projects map to repositories in the DevArchAI backend (single source of truth).

devsec project list
devsec project create https://github.com/org/repo
devsec project select <project-id>
devsec project current
devsec project show <project-id>

Scan

# From inside a git repo (detects origin/upstream + branch)
devsec scan

# Explicit repository URL (auto-registers if needed)
devsec scan --repo https://github.com/org/repo

# Selected or explicit project
devsec project select <id>
devsec scan
devsec scan --project <id> --branch develop

# Inspect scans
devsec scan status <scan-id>
devsec scan results <scan-id>

Scan lifecycle

Progress is backend-driven (WebSocket with polling fallback):

  1. Connect to repository
  2. Clone repository
  3. Detect technologies (dynamic — Docker, Kubernetes, Helm, Terraform, CI/CD, …)
  4. Scan infrastructure
  5. Analyze findings
  6. Scan completed
  7. AI recommendations (when enabled)

Results

After completion the CLI prints findings summary and a link to the web UI:

https://www.devarchai.xyz/repositories/<id>/results

Scans started from the CLI appear in the SaaS dashboard immediately.

CI/CD

export DEVSEC_API_URL=https://backend.devarchai.xyz
export DEVSEC_API_KEY=sk-...
devsec scan --repo https://github.com/org/repo --json --quiet --fail-on high

Exit codes:

Code Meaning
0 Success / scan passed policy
1 Policy violation (findings above --fail-on)
2 Usage error
3 Authentication error
4 API error
5 Scan failure

Configuration

Precedence (highest wins):

  1. Environment: DEVSEC_API_URL, DEVSEC_FRONTEND_URL, DEVSEC_API_KEY
  2. ~/.config/devsec/config.toml (non-secret values via devsec config)
  3. Production defaults
devsec config show
devsec config set api-url https://backend.devarchai.xyz
devsec config set frontend-url https://www.devarchai.xyz

Non-local API URLs must use HTTPS unless DEVSEC_ALLOW_HTTP=1.

Troubleshooting

Problem Fix
Authentication required Run devsec auth login or set DEVSEC_API_KEY
No Git remote found Add a remote or use devsec scan --repo <url>
Unable to reach the API Check network and DEVSEC_API_URL
Scan stuck / WebSocket fails CLI falls back to polling automatically
HTTPS error in production Use https:// API URL

Development

pip install -e "./cli[dev]"
cd cli
pytest -q
ruff check src tests
python -m build

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devsec-0.1.3.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devsec-0.1.3-py3-none-any.whl (56.9 kB view details)

Uploaded Python 3

File details

Details for the file devsec-0.1.3.tar.gz.

File metadata

  • Download URL: devsec-0.1.3.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for devsec-0.1.3.tar.gz
Algorithm Hash digest
SHA256 60533d8ff758774da3ccafd560637a911981b307044d3b134a2681708a32060a
MD5 d47e1f81108a88d69d3e2633054c0866
BLAKE2b-256 ab941f7e64b8089a645d8418e293e43f81d8be7e8f4540afc0403d0e59c758c6

See more details on using hashes here.

File details

Details for the file devsec-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: devsec-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 56.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for devsec-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4b535f8c9ddbd9e3d1a17e32db442984f52e8d39ae0a96bcb118b5bbb225429c
MD5 420bcf31a4edbd49b16835b3e87fe9b5
BLAKE2b-256 d5972abeef0b9166a58979e4060972115c02d4643c9c0c83fc27944c2ea6921e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page