ae-system
Use the system domain for Agent system administration:
Mandatory Rules
- These commands are only for users whose Agent role is
rootoragent_admin. - The te-agent
/api/admin/**and/api/cli/channel/v1/**endpoints are the final authorization boundaries. A member receives a permission error (HTTP 403). Do not retry login or attempt a different endpoint after a 403. - Run
ae-cli auth login --host <host>before using this domain. System administration requires a valid user CLI-token session; sandbox identity headers are not an authorization substitute. +npm-installis the exception that must also run inside a Linux te-agent sandbox because it packages the installed Linux files. It still requires the logged-in user to berootoragent_admin.- Discover real IDs with a list command before any update or delete. Never guess a user, sandbox, model, quota rule, or channel ID.
- Before every write, run
--dry-run, show the target and effect, and obtain explicit user confirmation. The CLI itself prompts only forhigh-risk-write;--yescan bypass that prompt and is not a security boundary. - Use
--dry-runto inspect method, path, query, and redacted body without executing. - JSON inputs accept inline JSON,
@file, or-for stdin. Prefer@filefor channel credentials and other sensitive values. - Successful output is JSON by default. Use
--format tableonly when a human-readable table is more useful. - After each command, check stderr and
_notice.host_compat. If present, show the version warning and its update commands before the business result. - Do not treat an absent ae-cli command as proof that an HTTP endpoint is unreachable. An Agent with Bash/network access can construct requests directly; server authentication, role checks, company isolation, and resource ownership are the actual controls.
- Do not call
DELETE /api/admin/members?openId=...or/api/internal/sandboxes/**through ad-hoc HTTP. They are intentionally excluded from this Skill because other systems own those integration contracts.
Command Groups
Members
Examples:
+list-members filters:
--q: login/display name search.--status:all | enabled | disabled.--page,--page-size: page size is 1-100.--all: return all matches.--sort-field periodUsedAmount,--sort-dir asc|desc: central usage sort.
+add-members --members schema:
Optional flags are --rule-id and --create-sandbox true|false.
Sandboxes
Examples:
Use Agent database user IDs from +list-members, not AE openIds, for sandbox commands.
Shared Sandbox Tools
Uploaded tools are registered for the current company with enabled=false. Upload does not activate the tool in any running sandbox. Review and enable/activate it through sandbox tool management after upload.
For activate/deactivate/status operations:
--target-mode selectedrequires 1-50--sandbox-ids;all-runningforbids them.--tool-idscontains 1-20 real IDs from+list-sandbox-tools.--command-names-by-tool-idoptionally limits an operation to named commands.--expected-tool-snapshots-by-idcarries the version/package/command snapshot returned by the server for optimistic concurrency checks.- JSON maps accept inline JSON,
@file, or stdin. Use dry-run and user confirmation before distribution changes.
Preferred npm Flow
Run this inside the target Linux te-agent sandbox:
For a scoped package or a custom shared-tool identifier:
Requirements and behavior:
--packagemust be an exact registry package version. Tags, ranges, URLs, Git sources, npm aliases, and local paths are rejected.- The installed package must expose at least one
package.jsonbinentry. Each bin becomes one tool command. - The default tool name is the unscoped package name. Use
--nameonly when a different valid lowercase tool identifier is required. - npm lifecycle scripts are disabled with
--ignore-scriptsby default. Use--allow-scripts trueonly after reviewing and trusting the package and all transitive dependencies. - The command calls the admin upload-policy endpoint before starting npm. A disabled feature, expired session, or non-admin role fails before installation.
- Installation uses a temporary prefix with development dependencies omitted. Temporary installation and ZIP files are removed whether upload succeeds or fails.
- npm-created
node_modules/.binsymlinks are converted to regular executable wrappers in the ZIP. All other symlinks, special files, and links resolving outside the package root are rejected. - Pure JavaScript Node.js CLIs are the supported baseline. Packages that require native addons, downloaded platform binaries, build tools, system libraries, or lifecycle setup may fail when scripts are disabled or when activated in a different runtime image.
- If lifecycle scripts are necessary, install and upload from the same Linux sandbox image family that will execute the tool. Upload never makes an incompatible native artifact portable.
Existing Directory Flow
Use the low-level command when the tool is already installed or assembled:
The directory root must contain exactly one tool.json. An external manifest is allowed only when the root has no tool.json:
Minimal manifest:
Upload contract:
nameand command names must start with a lowercase letter and contain only lowercase letters, numbers,.,_, or-, with a maximum length of 64.- Command names must not replace reserved runtime commands such as
node,npm,npx,bash,python,git,curl, orsudo. - Every command
entrymust be a regular file under the upload root. Useruntime: "node"for JavaScript entry files andruntime: "native"only for an executable compatible with the sandbox Linux image. - Paths must be relative and normalized. Absolute paths,
.., backslashes, control characters, empty segments, and acurrentpath segment are rejected. - ZIP limits are 50 MB compressed, 500 MB unpacked, 50 MB per file, and 10,000 files. The server publishes only after independently validating the same boundaries.
- Do not pre-create or write
/data/app/te_agent_ta/share/toolsfrom a sandbox. Sandboxes are read-only for that directory; the authenticated te-agent upload endpoint owns the final write and registration. - A tool name can be registered only once per company in this first static-version flow. Choose the final name and version before upload.
Models
Examples:
--biz-type is AE_AGENT | AI_QA and defaults to AE_AGENT. Use the database id returned by a model list, not the provider model name.
Usage
Examples:
Summary range:
- Use
--days 1..365, or provide both--start-dateand--end-date. - Dates use
YYYY-MM-DD. - Do not combine
--dayswith an absolute date pair. --refresh trueis available on+get-usage-summaryand+get-agent-tool-callsand bypasses the overview cache.
Details flags:
--start-dateand--end-dateare required.--group-by:user | model | date | app_type.- Optional filters:
--search,--open-id,--model-id,--model-scope,--app-type. --model-scoperequires--model-id.--sort-by:totalTokens | cost | share | requestCount.--sort-dir:asc | desc.
Combination drill-down requires exactly one parent selector:
user→--open-idonly.model→--model-idand--model-scopeonly.app_type→--app-typeonly.date→--dateonly, inside the selected range.
CSV exports require an explicit --output. The target is created exclusively: an existing file is never overwritten, and an HTTP or stream failure removes the incomplete file. The JSON result reports the absolute local path, bytes written, server filename, and content type.
Cost Control
Examples:
Quota rule JSON:
Rules:
subjectType:USER | COMPANY.periodType:DAY | WEEK | MONTH.quotaType:COST | TOKEN.- COST uses
budgetAmount; TOKEN usestotalTokens. Token values are expressed in millions. allowedModelsandmodelLimitsare optional according to the server rule type.- Update accepts a partial rule object.
Channels
For channel setup, routing, WhatsApp Web linking, or Feishu user binding, read references/channel-management.md [blocked] before taking action. It defines the two confirmation phases and the ae-cli plus Feishu OpenAPI MCP workflow.
Use canonical snake_case request fields. The four original commands also accept their legacy camelCase JSON fields for compatibility. Always use @file for credentials and batch rosters:
Permission Errors
A permission response looks like:
On this response:
- Do not retry with another admin path.
- Do not recommend re-login unless the server returned 401 instead.
- Tell the user that
rootoragent_adminis required.
An authenticated root or agent_admin is still scoped to their own company. The current service checks the database role and company against the session, and audited member, channel, sandbox-tool, and sandbox-management routes apply company/resource ownership checks. Never use that statement as a claim that every unreviewed admin route is safe.
Transport Status
This is a Transitional domain backed by te-agent /api/admin/** and /api/cli/channel/v1/**.
- Maintainer: te-agent admin/channel-management routes and
src/commands/te-system/**. - Migration target: system and channel Capability Gateways.
- Review date: 2026-10-24.
- Exit condition: migrate after equivalent gateway schema, auth, risk, dry-run, and output contracts are stable.


