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.2.tar.gz (63.7 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.2-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: devsec-0.1.2.tar.gz
  • Upload date:
  • Size: 63.7 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.2.tar.gz
Algorithm Hash digest
SHA256 a5c262303e1031026dc67d166c9bad310f2f549a783da6b9dca971c47fea434e
MD5 31fa900e7638b20fd32f4bcd24cdac51
BLAKE2b-256 9394b8b31332af67c213c455686e6eaf30aef41c3107d8f6d7ce5fb30a80ef9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: devsec-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 59.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aec704e12305a48c249a888ee6d16002c7201ac465787fc2ed994b8aeae03d1e
MD5 d2d601243a0903acd07b61f19389c283
BLAKE2b-256 e68e7e2b5b81f81a47cbf42542a74081b098d6e0637f6e4c24cf2a15afbd6bd6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

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