Appearance
Tutorial: One-click Environment Template
Create a reusable Aionis environment file once, then run all tutorials with consistent variables.
Before you start
- You have shell access (
bashorzsh). - You have a valid API key or bearer token.
- You know the target base URL, tenant, and scope.
What you will finish with
A single .env.aionis file that works across the tutorial commands in this docs set.
Tip - Copy and run Use the copy button at the top-right of each code block.
Input
| Variable | Required | Purpose | Example |
|---|---|---|---|
BASE_URL | Yes | Aionis service URL | http://localhost:3001 |
AIONIS_API_KEY | Yes | Auth for public API endpoints | aionis_live_xxx |
AIONIS_TENANT_ID | Yes | Tenant isolation key | default |
AIONIS_SCOPE | Yes | Scope isolation key | support |
Steps
Step 1: Generate .env.aionis
bash
cat > .env.aionis <<'EOF'
BASE_URL=http://localhost:3001
AIONIS_API_KEY=replace_with_real_key
AIONIS_TENANT_ID=default
AIONIS_SCOPE=support
EOFStep 2: Load variables into current shell
bash
set -a
source .env.aionis
set +aStep 3: Validate connectivity
bash
curl -sS "$BASE_URL/health" | jqExpected response sample
json
{
"ok": true
}Common failure and fix
Failure:
text
source: no such file or directory: .env.aionisFix:
- Ensure Step 1 ran successfully in the same working directory.
- Confirm file exists with
ls -la .env.aionis. - Re-run
source .env.aionis.
Success criteria
/healthreturns HTTP200.- The response payload indicates healthy service state.
BASE_URL,AIONIS_API_KEY,AIONIS_TENANT_ID, andAIONIS_SCOPEare available in your shell session.