retaskcli

package module
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

README

retask-cli

A command-line interface for Retask.work — manage workspaces, projects, tasks, sandboxes, agents, and more directly from your terminal or scripts.

Features

  • Full API coverage — workspaces, projects, tasks, sandboxes, sessions, agents, files, integrations, customer profiles
  • JSON-first output — pipe to jq, use in scripts, or add --pretty for human-readable tables
  • AI-agent friendlyretask help-llm prints a complete JSON manifest for LLM injection; every command has structured --help
  • Shared sandbox support--no-save / RETASK_NO_PERSIST prints export lines instead of writing to disk, keeping sessions isolated per shell
  • Multi-profile config — manage multiple endpoints and workspaces via ~/.config/retask/config.yaml
  • HTTP transportNWEB_API_TRANSPORT=http switches from gRPC to Connect protocol over HTTP, enabling proxy-based auth injection in secure sandboxes
  • Verbose logging--verbose prints the wire protocol, URL, and response status for every request to stderr

Installation

macOS / Linux
curl -fsSL https://retask.work/install.sh | sh
Windows (PowerShell)
irm https://retask.work/install.ps1 | iex
Go install
go install github.com/nwebxyz/retask-cli/cmd/retask@latest
Build from source
git clone https://github.com/nwebxyz/retask-cli
cd retask-cli
go build -ldflags "-X github.com/nwebxyz/retask-cli/internal/version.Version=$(git describe --tags)" -o retask ./cmd/retask/

Quick start

# Set your Personal Access Token and workspace
export NWEB_API_KEY="nweb_pat_..."
export NWEB_WORKSPACE_ID="ws_..."

# Exchange PAT for JWT (saved to ~/.config/retask/config.yaml)
retask auth login

# List your projects
retask project list

# Create a task
retask task create --project-id proj_abc --title "Fix login bug" --priority HIGH

# Update just one field (partial update)
retask task update task_xyz --status STATUS_DONE
Shared sandboxes (session-isolated credentials)

For shared environments where multiple users share a filesystem:

eval $(retask auth login --no-save)
# Exports NWEB_API_TOKEN and NWEB_WORKSPACE_ID into the current shell only

Nothing is written to disk. Each shell session is fully isolated.

HTTP transport (proxy-injected auth)

In secure sandboxes where outbound traffic passes through a proxy that injects Authorization headers automatically, use NWEB_API_TRANSPORT=http to switch from gRPC to Connect protocol over standard HTTP:

export NWEB_API_TRANSPORT=http
retask task list

The CLI still manages JWT auth normally when the variable is set — this is for environments where the proxy handles auth injection instead. Any value other than http (including unset) uses gRPC protocol.

Use --verbose to confirm which wire protocol is active:

retask project list --verbose
# [retask] > POST https://api.nweb.app/project.v1.ProjectService/GetProjects [gRPC]
# [retask]   Authorization: Bearer [redacted]
# [retask] < 200 OK

NWEB_API_TRANSPORT=http retask project list --verbose
# [retask] > POST https://api.nweb.app/project.v1.ProjectService/GetProjects [gRPC-Web]
# [retask]   Authorization: Bearer [redacted]
# [retask] < 200 OK

Authentication

Variable Required Description
NWEB_API_KEY Yes* Personal Access Token (nweb_pat_...). Never stored.
NWEB_API_TOKEN No Ready-to-use JWT. If set, skips PAT exchange entirely.
NWEB_API_ENDPOINT No Default: api.nweb.app:443
NWEB_WORKSPACE_ID Yes* Workspace scope. Required for most commands.
NWEB_API_TRANSPORT No Set to http to use Connect protocol over HTTP instead of gRPC.
RETASK_PROFILE No Active profile name. Default: default.
RETASK_NO_PERSIST No Suppress all credential writes to disk.

*Required unless NWEB_API_TOKEN is already set.

Global flags

Available on every command:

Flag Env Description
--profile RETASK_PROFILE Active config profile
--workspace-id NWEB_WORKSPACE_ID Override workspace ID
--pretty Human-readable table output
--insecure Skip TLS (local dev only)
--no-save RETASK_NO_PERSIST Don't write to config file
--config Config file path
--verbose Print request/response info to stderr

Commands

retask
├── auth
│   ├── login                  # PAT → JWT exchange, save to profile
│   ├── logout                 # Clear cached JWT
│   ├── whoami                 # Show current token info
│   └── pat list / create / revoke
├── workspace
│   ├── list / get / create / update / delete
│   └── member list / invite / update / remove
├── customer
│   ├── profile get / set
│   ├── list
│   └── get <id>
├── project
│   ├── list / get / create / update / delete
│   ├── archive / unarchive
│   └── member list / add / remove
├── file
│   └── list / get / delete / signed-url
├── integration
│   ├── provider list / get
│   ├── list / get / set / delete
│   └── github repos
├── task
│   ├── list / get / get-by-key
│   ├── create / update / delete
│   └── attachment add / remove
├── project-config
│   └── get / set
├── sandbox
│   ├── list / get / create / update / stop / delete
│   └── session list / get / create / update / stop / delete
└── agent
    └── list / get / create / update / delete

AI agent support

Run retask help-llm to get a complete JSON manifest of all commands, flags, and examples — designed to be injected into an LLM system prompt:

# Full manifest
retask help-llm

# Filter to task-related commands
retask help-llm | jq '.commands[] | select(.command | contains("task"))'

For a concise onboarding guide, run retask skill — it prints the skills/retask-cli.md Claude Code skill (Markdown), embedded in the binary so it works without the repo. Agents can read retask skill first, then drill into retask help-llm.

Multi-profile config

~/.config/retask/config.yaml:

active_profile: default
profiles:
  default:
    endpoint: api.nweb.app:443
    workspace_id: ws_abc123
  staging:
    endpoint: api.staging.nweb.app:443
    workspace_id: ws_xyz789

Switch profiles with --profile staging or RETASK_PROFILE=staging.

Development

Proto code generation

The proto sources live in proto/ and generated Go code in proto-gen/. To regenerate after updating protos:

./.bin/build_proto.sh

Requires buf and protoc-go-inject-tag.

Run tests
go test ./...
Build
go build -ldflags "-X github.com/nwebxyz/retask-cli/internal/version.Version=0.1.0" -o retask ./cmd/retask/

License

MIT

Documentation

Overview

Package retaskcli embeds shipped assets into the binary so commands can serve them without the source repository present. It exists at the module root because go:embed cannot reference files outside the embedding package's tree (e.g. ../skills), and skills/ lives at the repo root.

Index

Constants

This section is empty.

Variables

View Source
var SkillMarkdown string

SkillMarkdown is the contents of skills/retask-cli.md, the Claude Code skill file. Embedding the canonical file (rather than a copy) keeps `retask skill` in sync with the published skill by construction.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
retask command
cmd/retask/main.go
cmd/retask/main.go
internal
auth
internal/auth/token.go
internal/auth/token.go
client
internal/client/connect.go
internal/client/connect.go
cmd/agent
internal/cmd/agent/command.go
internal/cmd/agent/command.go
cmd/auth
internal/cmd/auth/command.go
internal/cmd/auth/command.go
cmd/comment
internal/cmd/comment/command.go
internal/cmd/comment/command.go
cmd/customer
internal/cmd/customer/command.go
internal/cmd/customer/command.go
cmd/file
internal/cmd/file/command.go
internal/cmd/file/command.go
cmd/helpcmd
internal/cmd/helpcmd/command.go
internal/cmd/helpcmd/command.go
cmd/integration
internal/cmd/integration/command.go
internal/cmd/integration/command.go
cmd/project
internal/cmd/project/command.go
internal/cmd/project/command.go
cmd/projectconfig
internal/cmd/projectconfig/command.go
internal/cmd/projectconfig/command.go
cmd/sandbox
internal/cmd/sandbox/command.go
internal/cmd/sandbox/command.go
cmd/skillcmd
internal/cmd/skillcmd/command.go
internal/cmd/skillcmd/command.go
cmd/task
internal/cmd/task/command.go
internal/cmd/task/command.go
cmd/workspace
internal/cmd/workspace/command.go
internal/cmd/workspace/command.go
config
internal/config/profile.go
internal/config/profile.go
flags
internal/flags/flags.go
internal/flags/flags.go
output
internal/output/output.go
internal/output/output.go
version
internal/version/version.go
internal/version/version.go
proto-gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL