微算力 · API 导航与自营网关
API 接入 EN
未登录登录
⏱️

终端自动化,高效管理工时

otta-cli · v0.1.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
效率 安全 A 级 作者 mekedron 公开目录收录
1.1k 下载 0 安装 5.1k 收藏 1 浏览

简介

通过终端自动化管理 Otta 工时系统,支持考勤记录、请假管理与日历导出,适合 DevOps 流程集成。

原始描述

Use `otta-cli` to automate `otta.fi` workflows from terminal. This tool is usually used for tracking working time, absences, and sick leaves: authenticate, i...

通过你的 Agent 添加

安装目录:otta-cli/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/otta-cli/
Codex CLI~/.codex/skills/otta-cli/
DeepSeek Harness~/.agents/skills/otta-cli/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: otta-cli description: "Use otta-cli to automate otta.fi workflows from terminal. This tool is usually used for tracking working time, absences, and sick leaves: authenticate, inspect config/cache, check account status, manage worktimes (list/add/update/delete), browse absences, fetch holidays, and generate combined calendar overviews. Trigger this skill when a request needs CLI-first Otta operations, OTTA_CLI_* environment setup, machine-readable --format json output, or diagnosis of auth/config/API validation errors."

Otta CLI

Use this skill to execute Otta time-tracking tasks end-to-end with repeatable CLI commands.

Main repository: https://github.com/mekedron/otta-cli

Quick Start

  1. Use the otta binary directly.

  2. Verify command surface and storage paths.

otta --help
otta config path
otta config cache-path
  1. Authenticate and hydrate cache.
otta auth login --username "$OTTA_CLI_USERNAME" --password "$OTTA_CLI_PASSWORD" --format json
otta status --format json
  • status updates cached user metadata (for user and worktimegroup fallbacks used by worktimes/holidays/calendar commands).
  • For non-interactive automation, prefer --password-stdin or secret env handling to reduce shell history exposure.

Command Recipes

Use explicit dates/times in YYYY-MM-DD and HH:MM formats.

List worktimes:

otta worktimes list --date 2026-02-20 --format json

Add worktime:

otta worktimes add \
  --date 2026-02-20 \
  --start 09:00 \
  --end 17:00 \
  --pause 30 \
  --project <project-id> \
  --worktype <worktype-id> \
  --description "Example task description" \
  --format json
  • --user is optional if OTTA_CLI_USER_ID or cached user ID exists.

Update worktime:

otta worktimes update --id <worktime-id> --start 10:00 --end 18:00 --format json
  • Send at least one changed field with --id.

Delete worktime:

otta worktimes delete --id <worktime-id> --format json

Fetch holidays/workday calendar:

otta holidays \
  --from 2026-02-20 \
  --to 2026-02-29 \
  --worktimegroup <worktimegroup-id> \
  --format json
  • --worktimegroup is optional if OTTA_CLI_WORKTIMEGROUP_ID or cached value exists.

Browse absences:

otta absence browse \
  --from 2026-02-01 \
  --to 2026-02-28 \
  --format json

Generate combined calendar overview:

otta calendar overview \
  --from 2026-02-01 \
  --to 2026-02-28 \
  --format json

Generate absence comment text:

otta absence comment \
  --type sick \
  --from 2026-02-20 \
  --to 2026-02-20 \
  --details "Flu symptoms" \
  --format json

Environment Variables

Use these variables when running in CI/non-interactive environments:

  • OTTA_CLI_CONFIG_PATH
  • OTTA_CLI_CACHE_PATH
  • OTTA_CLI_API_BASE_URL
  • OTTA_CLI_CLIENT_ID
  • OTTA_CLI_USERNAME
  • OTTA_CLI_PASSWORD
  • OTTA_CLI_ACCESS_TOKEN
  • OTTA_CLI_TOKEN_TYPE
  • OTTA_CLI_REFRESH_TOKEN
  • OTTA_CLI_TOKEN_SCOPE
  • OTTA_CLI_USER_ID
  • OTTA_CLI_WORKTIMEGROUP_ID

Agent Operating Rules

  1. Prefer --format json for all data-producing commands and parse response fields instead of scraping text output.
  2. Run status --format json before operations that rely on cached user/worktimegroup metadata.
  3. Validate dates/times before command execution (YYYY-MM-DD, HH:MM).
  4. Run worktimes list before update or delete when IDs are not explicitly known.
  5. Return exact command, exit code, and concise stderr message when failures happen.
  6. Never print raw credentials or tokens in summaries.

Failure Recovery

  • no access token configured (run \otta auth login`)`
    • Run auth login, then rerun status.
  • username is required (use --username)
    • Pass --username or set OTTA_CLI_USERNAME.
  • --worktimegroup is required (...)
    • Pass --worktimegroup, set OTTA_CLI_WORKTIMEGROUP_ID, or run status to refresh cache.
  • --date must be YYYY-MM-DD, --start must be HH:MM, --to must be greater than or equal to --from
    • Correct input format/order, rerun command.
  • directory ... is contained in a module that is not one of the workspace modules listed in go.work
    • Build/run with GOWORK=off in this repository context.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

cliautomationtime-trackinghrproductivityapi-clientjson-outputci-cd

同类 Skill