Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# E2E - builds the CLI and runs ./e2e against a live deployed stack (default
# dev). Self-contained: when E2E_AUTH_* secrets are absent, the @p0 round trip
# signs up a throwaway account (open signup on dev). No browser binaries needed
# (request-only tests).
name: E2E

on:
pull_request:
branches: [master]
push:
branches: [master]
workflow_dispatch:
inputs:
target:
description: 'Target site FQDN'
default: 'dev.agentage.io'

jobs:
e2e:
name: 🧪 E2E vs ${{ inputs.target || 'dev.agentage.io' }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 📥 Checkout code
uses: actions/checkout@v6

- name: 🔧 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: 'npm'

- name: 📦 Install dependencies
run: npm ci

- name: 🏗️ Build
run: npm run build

- name: 🧪 Run e2e
run: npm run test:e2e
env:
AGENTAGE_SITE_FQDN: ${{ inputs.target || 'dev.agentage.io' }}
E2E_AUTH_EMAIL: ${{ secrets.E2E_AUTH_EMAIL }}
E2E_AUTH_PASSWORD: ${{ secrets.E2E_AUTH_PASSWORD }}

- name: 📊 Upload report
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-report
path: playwright-report/
retention-days: 7
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [0.25.0] - 2026-06-12

### Changed
- **BREAKING - Memory client reboot.** The CLI is now the agentage Memory client.
All agent-runtime commands were removed: run, agents, runs, machines, schedules,
projects, vault, daemon, logs, create, config, whoami (folded into status),
completions, update, setup mcp. The local daemon (:4243) is gone - the CLI is stateless.
- `setup` now signs in via OAuth 2.1 (Dynamic Client Registration + PKCE) against
auth.agentage.io with a localhost callback; flags: `--disconnect`, `--reauth`, `--no-browser`.
- `status` shows account, plan, memories, and endpoint health (`--json` supported).
- Dependencies reduced to chalk + commander + open.

## [0.24.6] - 2026-04-26

### New Features
Expand Down
103 changes: 37 additions & 66 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,37 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

**@agentage/cli** — CLI and daemon for the Agentage platform. Provides the `agentage` command-line tool and a local daemon process that discovers, runs, and manages AI agents.

**Repository:** `agentage/cli`
**Default Branch:** `master`
**Package:** Single npm package (ESM)

## Development Commands

```bash
npm install # Install dependencies
npm run build # Compile TypeScript (tsc)
npm test # Run Vitest unit tests
npm run type-check # TypeScript checking
npm run lint # ESLint
npm run format:check # Prettier check
npm run verify # Full pipeline: type-check + lint + format:check + build + test
npm run clean # Clean dist/
```

## Architecture

```
src/
├── cli.ts # CLI entrypoint (Commander.js)
├── commands/ # CLI commands (init, publish, list, etc.)
├── daemon/ # Local daemon (Express + WebSocket)
├── hub/ # Hub client for cloud interactions
├── discovery/ # Agent discovery from filesystem
└── utils/ # Shared utilities
```

### Key Patterns

- **CLI:** Commander.js command definitions in `src/commands/`
- **Daemon:** Express.js HTTP + WebSocket server for agent lifecycle management
- **Discovery:** Filesystem scanning for `.agent.md` and `.agent.ts` files
- **Hub Integration:** Supabase client for cloud platform communication

### Key Dependencies

- `@agentage/core`, `@agentage/platform` — Agent framework
- `commander` — CLI framework
- `express`, `ws` — Daemon server
- `@supabase/supabase-js` — Cloud platform
- `gray-matter` — Agent manifest parsing
- `chalk` — Terminal output

## Testing

- **Framework:** Vitest
- **Pattern:** `*.test.ts` colocated with source
- **Coverage:** 70% minimum threshold

## Publishing

Published to npm as `@agentage/cli`. **Never run `npm publish` manually** — use the automated release pipeline via GitHub Actions.

## Standards

See [root CLAUDE.md](../../CLAUDE.md) and [agentage CLAUDE.md](../CLAUDE.md) for cross-repo conventions, branching strategy, and tech standards.
# CLAUDE.md - @agentage/cli

Terminal client for agentage Memory. v0.25 reboot: `setup` (OAuth sign-in) + `status` only.
The pre-0.25 agent-runtime CLI (daemon, run/agents/machines/...) lives in git history only -
do not resurrect patterns from it.

## Layout
- `src/cli.ts` - commander entry (excluded from coverage; keep logic out of it)
- `src/commands/` - thin command wiring; flow logic takes injected `Deps` for testability
- `src/lib/` - origins (one FQDN -> service URLs), config (`~/.agentage`, 0600 auth.json),
oauth (DCR + PKCE), callback-server (one-shot localhost), api (bearer + refresh-once),
status-info
- `src/package-guard.test.ts` - CI guard: no daemon/agent-runtime remnants, runtime deps
stay exactly `chalk + commander + open`

## Auth model
Fresh DCR public client per `setup` run (the redirect URI binds the ephemeral callback
port); `client_id` stored in auth.json for the refresh grant. Tokens are opaque; `status`
validates them via the OAuth introspection endpoint (`/api/auth/mcp/get-session`).
Account details (email/plan/memories) in `status` are pending OAuth-bearer support in the
backend REST API - it currently accepts session cookies only.

## E2E (`./e2e`, Playwright)
Drives the built `dist/cli.js` as a subprocess against a live stack (default dev target).
`@smoke` = version + degraded status; `@p0` = full headless OAuth round trip - the test
plays "the browser": signed-in session (Origin-stamped request context - the AS 403s
cookie POSTs without it) -> authorize 302 -> the CLI's localhost callback. Self-contained:
without `E2E_AUTH_*` env it signs up a throwaway account per run. Run via `npm run build
&& npm run test:e2e`; CI runs it in `e2e.yml` on every PR. Never point it at production.

## Conventions
- `AGENTAGE_SITE_FQDN` selects the target host (production default); `AGENTAGE_CONFIG_DIR`
overrides the config dir - e2e isolation depends on it, never remove
- `npm run verify` before any push; CI also runs `test:coverage` (thresholds 65/70/70/70)
- Conventional commits; publish only via the release workflow, never local `npm publish`
- This is a PUBLIC repo: no secrets, no internal hosts, no roadmap, no provider names in
code, docs, comments, or commit messages
Loading