Installation
The DevAegis CLI requires Node.js 18+. Install it globally via npm:
# Install globally
npm install -g devaegis
# Verify installation
devaegis --versionOr 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.comFor CI/CD environments where browser auth is not possible, use an API key:
devaegis login --token YOUR_API_KEYGenerate 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_IDBuilding & 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 ./distSpecify output directory
devaegis protect --dir ./dist --out ./dist-protectedObfuscation 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 aggressiveWatch mode (development)
Protect on every build change during development:
devaegis protect --dir ./dist --watchRuntime 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-runtimeNext.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_hereGet 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 hereAdd 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 accountdevaegis logoutRemove local authenticationdevaegis initLink current directory to a DevAegis projectdevaegis protect --dir <path>Encrypt and obfuscate a build directorydevaegis statusCheck the payment status of the linked projectdevaegis killActivate kill switch on the linked projectdevaegis reviveDeactivate kill switch on the linked projectdevaegis projectsList all your Aegis projectsdevaegis whoamiShow the currently authenticated accountTroubleshooting
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.
