DevAegis
DevAegis
Get Started
Documentation

CLI Guide

The DevAegis CLI encrypts and deploys your protected builds. Integrate it into your existing workflow in minutes.

Last updated: April 2026

Installation

The DevAegis CLI requires Node.js 18+. Install it globally via npm:

# Install globally npm install -g devaegis # Verify installation devaegis --version

Or use it without installing via npx:

npx devaegis [command]

Authentication

Authenticate the CLI with your DevAegis account. This generates a CLI token stored locally in ~/.devaegis/config.json.

devaegis login # Outputs: # Opening browser for authentication... # Authenticated as you@example.com

For CI/CD environments where browser auth is not possible, use an API key:

devaegis login --token YOUR_API_KEY

Generate API keys from Settings - API Keys in the dashboard.

Linking a Project

Each codebase links to one DevAegis project. Run this in your project root:

devaegis init # Prompts: # ? Select a project: [your projects listed] # Writing .devaegis.json... # Project linked. Add .devaegis.json to version control.

This creates a .devaegis.json file with your project ID. Commit this file - it's not sensitive. The encryption keys are derived server-side.

Or link directly with a project ID from the dashboard:

devaegis init --project YOUR_PROJECT_ID

Building & Protecting

Basic protect command

After building your project, run devaegis protect to encrypt and obfuscate the output:

# Build your project first npm run build # Then protect the output devaegis protect --dir ./dist

Specify output directory

devaegis protect --dir ./dist --out ./dist-protected

Obfuscation level

Control how aggressively the code is obfuscated. Higher levels take longer but are harder to reverse-engineer.

# Levels: light | standard | aggressive devaegis protect --dir ./dist --level aggressive

Watch mode (development)

Protect on every build change during development:

devaegis protect --dir ./dist --watch

Runtime Integration

The DevAegis runtime SDK enforces payment status in your client's deployed environment. Install it in the project you're protecting:

npm install devaegis-runtime

Next.js integration

// middleware.ts import { aegisMiddleware } from 'devaegis-runtime/next'; export default aegisMiddleware(); export const config = { matcher: ['/((?!_next/static|favicon).*)'], };

Express / Node.js integration

import { aegis } from 'devaegis-runtime'; app.use(aegis());

The runtime checks your project's payment status on every request (cached for 60 seconds to avoid latency). When the invoice is overdue or kill switch is active, it serves the payment screen instead of your app.

Environment variable

The runtime reads the project key from an environment variable. Set this on your client's server:

DEVAEGIS_PROJECT_KEY=your_project_key_here

Get the project key from the Aegis dashboard. Never commit this key to version control - it's the key that unlocks your client's access.

CI/CD Integration

Add DevAegis to your deployment pipeline. Example GitHub Actions workflow:

# .github/workflows/deploy.yml name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - name: Install dependencies run: npm ci - name: Build run: npm run build - name: Protect with DevAegis run: npx devaegis protect --dir ./dist env: DEVAEGIS_TOKEN: ${ secrets.DEVAEGIS_TOKEN } - name: Deploy run: # your deploy command here

Add DEVAEGIS_TOKEN as a secret in your repository settings. Generate a CLI token from the DevAegis dashboard under Settings - API Keys.

Commands Reference

devaegis loginAuthenticate with your DevAegis account
devaegis logoutRemove local authentication
devaegis initLink current directory to a DevAegis project
devaegis protect --dir <path>Encrypt and obfuscate a build directory
devaegis statusCheck the payment status of the linked project
devaegis killActivate kill switch on the linked project
devaegis reviveDeactivate kill switch on the linked project
devaegis projectsList all your Aegis projects
devaegis whoamiShow the currently authenticated account

Troubleshooting

Authentication fails

Run devaegis logout then devaegis login again. If using a token, verify it hasn't been revoked in the dashboard.

Project not found

Check that .devaegis.json exists in the current directory and the project ID matches an active project in your dashboard.

Runtime not enforcing

Verify DEVAEGIS_PROJECT_KEY is set correctly on the deployed server. Check that the runtime middleware is applied before any route handlers.

Build errors after protection

Aggressive obfuscation can occasionally conflict with certain bundler outputs. Try --level standard as a fallback. Report persistent issues to support@devaegis.com.

← Back to DevAegis