npm package: @novateva/teurtask-cli
Description: CLI for teurtask project management API
Latest version: 0.1.7

# teurtask CLI

CLI for Teurtask project management operations. It supports environment management, browser login, and day-to-day CRUD/reporting actions across projects, tasks, sprints, phases, goals, tags, comments, schedules, users, scores, notifications, and documents.

## What this CLI is for

Use `teurtask` to:

- switch between local/dev/prod API environments
- authenticate from terminal via browser login
- automate team/project operations from scripts or shell aliases
- inspect and manage delivery lifecycle (project -> phase -> sprint -> task)
- manage related entities (goals, tags, comments, schedules, users, scores)
- handle personal flows (active tasks, personal tasks, notifications)

## Install and run

Requirements:

- Node.js 20+
- npm

Install dependencies:

```bash
npm install
```

Run in development mode:

```bash
npm run dev -- --help
```

Build TypeScript:

```bash
npm run build
```

Run tests:

```bash
npm test
```

Use the CLI directly:

```bash
npx tsx bin/teurtask.ts --help
```

## Global options

These options work across commands:

- `--json` output machine-readable JSON
- `--env <name>` override active environment for a command
- `--verbose` verbose logging/output

Example:

```bash
npx tsx bin/teurtask.ts --env dev --json task list --active
```

## Environments and config

The CLI stores state in:

- `~/.teurtask/config.json` for environments and active environment
- `~/.teurtask/auth.json` for tokens and user data per environment

Default environments:

- `local` -> `http://localhost:8000/api`
- `dev` -> `https://dev-api.teurtask.com/api`
- `prod` -> `https://api.teurtask.com/api`

Security note:

- auth file permissions are set to user-only (`0600`) when tokens are saved

Useful commands:

```bash
teurtask env list
teurtask env show
teurtask env set dev
teurtask env add staging --api-url "https://staging-api.example.com/api" --web-url "https://staging.example.com"
```

## Authentication

```bash
teurtask auth login
teurtask auth me
teurtask auth refresh
teurtask auth logout
```

## Complete command reference

### `env`

- `env list`
- `env set <name>`
- `env show`
- `env add <name> --api-url <url> --web-url <url>`

### `auth`

- `auth login`
- `auth logout`
- `auth me`
- `auth refresh`

### `project`

- `project list [--archived]`
- `project get <id> [--with-sprints] [--with-goals]`
- `project create --name <name> --description <description> [--administrative] [--clients <ids>]`
- `project update <id> [--name <name>] [--description <description>] [--archived] [--administrative] [--clients <ids>]`
- `project delete <id>`
- `project backlog <id> [--start-date <date>] [--end-date <date>] [--tags <ids>] [--goal <id>] [--users <ids>] [--sprint <ids>] [--phase <ids>] [--state <states>] [--task-name <name>] [--per-page <n>] [--with-duration]`
- `project archive <id>`

### `task`

- `task list [--project-id <id>] [--sprint-id <id>] [--with-users] [--with-project] [--with-sprint] [--with-tags] [--with-goal] [--active] [--personal]`
- `task get <id> [--with-users] [--with-comments] [--with-reviewer] [--with-duration]`
- `task create --title <title> --state <state> [--sprint-id <id>] [--phase-id <id>] [--project-id <id>] [--users <ids>] [--deadline <date>] [--description <text>] [--start-date <date>] [--priority <priority>] [--story-point <n>] [--reviewer-id <id>] [--goal-id <id>] [--is-recurrent <bool>] [--type-tasks <ids>] [--tags <ids>]`
- `task update <id> [--title <title>] [--state <state>] [--description <text>] [--priority <priority>] [--difficulty <difficulty>] [--story-point <n>] [--deadline <date>] [--start-date <date>] [--finish-date <date>] [--sprint-id <id>] [--users <ids>] [--type-tasks <ids>] [--tags <ids>] [--reviewer-id <id>]`
- `task delete <id>`
- `task track <id>`
- `task state <id> <state>`
- `task active`

### `sprint`

- `sprint list [--project-id <id>] [--phase-id <id>] [--archived] [--page <n>] [--page-size <n>] [--with-project] [--with-phase] [--with-users] [--with-tasks] [--with-sprint-metrics]`
- `sprint get <id>`
- `sprint create --project-id <id> --phase-id <id> --start-date <date> --deadline <date> [--description <text>] [--should-fill-daily] [--users <userId:capacity,...>] [--task-ids <ids>] [--responsible-ids <ids>]`
- `sprint update <id> [--description <text>] [--start-date <date>] [--deadline <date>] [--users <userId:capacity,...>] [--responsible-ids <ids>]`
- `sprint delete <id>`
- `sprint close --sprint-id <id> --score-client <n> --comment-client <text> --review-users <reviews> [--open-new] [--task-ids <ids>]`
- `sprint report <id>`

### `user`

- `user list [--sprint-id <id>]`
- `user get <id>`
- `user create --name <name> --last-name <lastName> --email <email> --id-card <idCard> --address <address> --charge <charge> --phone <phone> --role-id <n> --date-of-birth <date> --hour-price <n> [--url-avatar <url>] [--authorized] [--manual-limit <n>]`
- `user update <id> [--name <name>] [--last-name <lastName>] [--email <email>] [--id-card <idCard>] [--address <address>] [--charge <charge>] [--phone <phone>] [--role-id <n>] [--date-of-birth <date>] [--hour-price <n>] [--url-avatar <url>] [--authorized] [--manual-limit <n>]`
- `user personal-tasks`
- `user payments`

### `comment`

- `comment list <taskId>`
- `comment create --task-id <id> --description <text> [--data-daily-id <id>]`
- `comment update <id> [--description <text>]`
- `comment delete <id>`

### `phase`

- `phase list [--project-id <id>] [--with-project] [--with-users] [--with-tasks]`
- `phase get <id>`
- `phase create --name <name> --start-date <date> --end-date <date> --project-id <id> [--invoice-number <number>] [--amount <n>]`
- `phase update <id> [--name <name>] [--start-date <date>] [--end-date <date>] [--project-id <id>] [--invoice-number <number>] [--amount <n>]`
- `phase report <id> [--sprint-id <id>]`
- `phase close <id> --score-client <n> --comment-client <text> [--create-phase] [--create-sprint]`

Important:

- `phase create` creates the phase in `Created` state.
- To activate the phase (`Doing`), run `sprint create` with `--phase-id <phaseId>`.

### `notification`

- `notification list`
- `notification read <id>`
- `notification read-all`
- `notification delete <id>`
- `notification delete-all`

### `schedule`

- `schedule list --start <timestamp> --end <timestamp> --users-id <ids>`
- `schedule get <id>`
- `schedule create --title <title> --body <body> --start <timestamp> --end <timestamp> --category <category> --location <location> --state <state> --user-id <n> --task-id <n> [--type <type>]`
- `schedule update <id> [--title <title>] [--body <body>] [--start <timestamp>] [--end <timestamp>] [--category <category>] [--location <location>] [--state <state>] [--user-id <n>] [--task-id <n>] [--type <type>]`
- `schedule delete <id>`

### `goal`

- `goal list [--project-id <id>] [--name <name>] [--tags <ids>]`
- `goal get <id>`
- `goal create --name <name> --project-id <id> [--tags <ids>]`
- `goal update <id> [--name <name>] [--tags <ids>]`
- `goal delete <id>`

### `tag`

- `tag list [--project-id <id>] [--name <name>]`
- `tag get <id>`
- `tag create --name <name> --project-id <id>`
- `tag update <id> [--name <name>]`
- `tag delete <id>`

### `score`

- `score list [--task-id <id>] [--with-user]`
- `score get <id>`
- `score create --score <n> --state <state> --deadline-task <date> --task-id <n> --dedicated-hours <n> --dificulty <dificulty> [--description <text>]`
- `score update <id> [--score <n>] [--state <state>] [--deadline-task <date>] [--task-id <n>] [--dedicated-hours <n>] [--dificulty <dificulty>] [--description <text>]`
- `score delete <id>`

### `document`

- `document delete <id>`

`document` upload/store is not currently implemented in this CLI.

## Common workflows

### 1) First-time setup

```bash
teurtask env list
teurtask env set dev
teurtask auth login
teurtask auth me
```

### 2) Create delivery structure

```bash
teurtask project create --name "Platform Revamp" --description "Q2 delivery"
teurtask phase create --name "Phase 1" --start-date "2026-03-01" --end-date "2026-03-31" --project-id 1
teurtask sprint create --project-id 1 --phase-id 1 --start-date "2026-03-01" --deadline "2026-03-14" --description "Sprint 1"
teurtask task create --title "Implement login" --state "todo" --project-id 1 --sprint-id 1 --priority "high"
```

Activation rule:

- `phase create` alone does not activate the phase.
- Use `sprint create --phase-id <phaseId>` to move phase state to `Doing`.

### 3) Daily execution

```bash
teurtask task active
teurtask user personal-tasks
teurtask comment create --task-id 42 --description "Progress update"
teurtask notification list
teurtask notification read-all
```

### 4) Reporting and closure

```bash
teurtask sprint report 1
teurtask phase report 1
teurtask sprint close \
  --sprint-id 1 \
  --score-client 9 \
  --comment-client "Delivered as expected" \
  --review-users "1000:9:Great ownership;1001:8:Good delivery"
```

`--review-users` format:

- Semicolon-separated entries.
- Each entry: `user_id:score:comment`
- Example: `"1000:10:Excellent sprint;1001:8:Delivered scope"`

## Tips

- Use `--json` whenever you need integration with scripts.
- Use command-specific help to inspect argument details quickly:
  - `teurtask <group> --help`
  - `teurtask <group> <command> --help`