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):
- Connect to repository
- Clone repository
- Detect technologies (dynamic — Docker, Kubernetes, Helm, Terraform, CI/CD, …)
- Scan infrastructure
- Analyze findings
- Scan completed
- 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):
- Environment:
DEVSEC_API_URL,DEVSEC_FRONTEND_URL,DEVSEC_API_KEY ~/.config/devsec/config.toml(non-secret values viadevsec config)- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60533d8ff758774da3ccafd560637a911981b307044d3b134a2681708a32060a
|
|
| MD5 |
d47e1f81108a88d69d3e2633054c0866
|
|
| BLAKE2b-256 |
ab941f7e64b8089a645d8418e293e43f81d8be7e8f4540afc0403d0e59c758c6
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b535f8c9ddbd9e3d1a17e32db442984f52e8d39ae0a96bcb118b5bbb225429c
|
|
| MD5 |
420bcf31a4edbd49b16835b3e87fe9b5
|
|
| BLAKE2b-256 |
d5972abeef0b9166a58979e4060972115c02d4643c9c0c83fc27944c2ea6921e
|