# Local CLI Testing

Guide local HumanLayer CLI login and create local test tasks and sessions

- Repository: https://github.com/humanlayer/humanlayer (12740 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add humanlayer/humanlayer --skill local-cli-testing -g -a claude-code -y`
Codex: `npx skills add humanlayer/humanlayer --skill local-cli-testing -g -a codex -y`
Cursor: `npx skills add humanlayer/humanlayer --skill local-cli-testing -g -a cursor -y`
Gemini CLI: `npx skills add humanlayer/humanlayer --skill local-cli-testing -g -a gemini-cli -y`

## Description

Guide local HumanLayer CLI login and create local test tasks and sessions

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Local CLI Testing

Test Riptide API flows through `apps/cli` without the UI.

## Login (Interactive)

The local CLI defaults to WorkOS device auth, so no callback URL is required. Loopback PKCE is opt-in with `HUMANLAYER_CLI_AUTH_METHOD=loopback`; if using it, add the exact redirect URI `http://localhost:39173/callback` in WorkOS, or set `HUMANLAYER_CLI_AUTH_PORT=<port>` and add the matching exact URI.

Ask the user to run:

```bash
WORKOS_CLIENT_ID="$(grep '^WORKOS_CLIENT_ID=' .env | cut -d= -f2-)" \
DEV_API_ORIGIN=http://localhost:8700 \
DEV_SYNC_ORIGIN=http://localhost:8888 \
bun --bun apps/cli/src/index.ts --dev login
```

If `400 invalid client`, confirm `WORKOS_CLIENT_ID` is the public WorkOS client id for the target environment.

Verify:

```bash
WORKOS_CLIENT_ID="$(grep '^WORKOS_CLIENT_ID=' .env | cut -d= -f2-)" \
DEV_API_ORIGIN=http://localhost:8700 \
DEV_SYNC_ORIGIN=http://localhost:8888 \
bun --bun apps/cli/src/index.ts --dev api sync online-hosts --limit 5
```

## Create Task

```bash
WORKOS_CLIENT_ID="$(grep '^WORKOS_CLIENT_ID=' .env | cut -d= -f2-)" \
DEV_API_ORIGIN=http://localhost:8700 \
DEV_SYNC_ORIGIN=http://localhost:8888 \
bun --bun apps/cli/src/index.ts --dev api tasks create \
  --name "Task Name" \
  --slug "task-slug" \
  --default-working-directory "$PWD" \
  --workflow-type outline_only \
  --worktree-timing later
```

Workflow types: `rpi`, `outline_only`, `prd_tdd`, `oneshot` (omit for freeform)
Worktree timing: `now`, `later`, `never`

## Upload Artifact

```bash
WORKOS_CLIENT_ID="$(grep '^WORKOS_CLIENT_ID=' .env | cut -d= -f2-)" \
DEV_API_ORIGIN=http://localhost:8700 \
DEV_SYNC_ORIGIN=http://localhost:8888 \
bun --bun apps/cli/src/index.ts --dev api uploads upsert-text \
  --task-id "TASK_ID" \
  --file-name "ticket.md" \
  --content "Ticket content here"
```

## Launch Session

The rest: https://github.com/humanlayer/humanlayer/blob/HEAD/.claude/skills/test-it-locally/references/local-cli-testing/SKILL.md
