← Back to Skills Marketplace
axelhu

Vikunja Usage

by AxelHu · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ pending
74
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install vikunja-usage
Description
任务管理工具:通过 Vikunja REST API v1 创建项目、任务、标签和评论,支持任务搜索、过滤、完成状态切换。Requires: curl。读取 $VIKUNJA_TOKEN 环境变量或 $AGENT_WORKSPACE/config/.vikunja-token 文件获取 token,支持多 agent。
README (SKILL.md)

Vikunja Task Manager

Vikunja 是一个轻量开源任务管理工具,部署于 http://localhost:3456,REST API v1。

凭证(多 Agent 支持)

Token 支持两种读取方式(按优先级):

  1. 环境变量 VIKUNJA_TOKEN(推荐,适合 agent 运行时注入)
  2. Token 文件 $AGENT_WORKSPACE/config/.vikunja-token(每个 agent 有自己独立的 token 文件)

获取 Token

RESP=$(curl -s -X POST http://localhost:3456/api/v1/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"your-user","password":"your-pass"}')
TOKEN=$(echo "$RESP" | grep -o '"token":"[^"]*"' | cut -d'"' -f4)
echo "$TOKEN"

存入 token 文件(每个 agent 不同路径):

mkdir -p "$AGENT_WORKSPACE/config"
echo "$TOKEN" > "$AGENT_WORKSPACE/config/.vikunja-token"
chmod 600 "$AGENT_WORKSPACE/config/.vikunja-token"

读取 Token

get_token() {
  [ -n "$VIKUNJA_TOKEN" ] && { echo "$VIKUNJA_TOKEN"; return; }
  [ -f "$AGENT_WORKSPACE/config/.vikunja-token" ] && cat "$AGENT_WORKSPACE/config/.vikunja-token"
}
TOKEN=$(get_token)

多 Agent 场景:每个 agent 独立 login,token 互不干扰。Vikunja 本身 token 无过期时间,可长期使用。

项目(Projects)

# 列出项目
curl -s http://localhost:3456/api/v1/projects -H "Authorization: Bearer $TOKEN"

# 创建项目(PUT /projects)
curl -s -X PUT http://localhost:3456/api/v1/projects \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"title":"项目名","description":""}'

# 获取项目
curl -s http://localhost:3456/api/v1/projects/{id} -H "Authorization: Bearer $TOKEN"

# 更新项目(POST)
curl -s -X POST http://localhost:3456/api/v1/projects/{id} \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"title":"新标题"}'

# 删除项目
curl -s -X DELETE http://localhost:3456/api/v1/projects/{id} -H "Authorization: Bearer $TOKEN"

任务(Tasks)

⚠️ 创建用 PUT /projects/{id}/tasks,更新用 POST /tasks/{id}

# 在项目里创建任务(PUT,不是 POST)
curl -s -X PUT http://localhost:3456/api/v1/projects/{project_id}/tasks \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"title":"任务标题","description":"描述","priority":2}'

# 更新任务(POST,不是 PUT)
curl -s -X POST http://localhost:3456/api/v1/tasks/{task_id} \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"done":true,"priority":3}'

# 列出所有任务
curl -s http://localhost:3456/api/v1/tasks -H "Authorization: Bearer $TOKEN"

# 搜索标题
curl -s "http://localhost:3456/api/v1/tasks?s=关键词" -H "Authorization: Bearer $TOKEN"

# 过滤(done=false 只显示未完成)
curl -s "http://localhost:3456/api/v1/tasks?filter=done%20%3D%20false" \
  -H "Authorization: Bearer $TOKEN"

# 列出某项目任务
curl -s http://localhost:3456/api/v1/projects/{project_id}/tasks \
  -H "Authorization: Bearer $TOKEN"

# 删除任务
curl -s -X DELETE http://localhost:3456/api/v1/tasks/{id} -H "Authorization: Bearer $TOKEN"

评论(Comments)

# 添加评论(字段名是 comment,不是 text)
curl -s -X PUT http://localhost:3456/api/v1/tasks/{task_id}/comments \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"comment":"评论内容"}'

# 获取评论
curl -s http://localhost:3456/api/v1/tasks/{task_id}/comments \
  -H "Authorization: Bearer $TOKEN"

标签(Labels)

# 创建标签
curl -s -X PUT http://localhost:3456/api/v1/labels \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"title":"in-progress","color":"#ff9900"}'

# 给任务打标签
curl -s -X PUT http://localhost:3456/api/v1/tasks/{task_id}/labels \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"labels": [{"id": 1}]}'

负责人(Assignees)

# 分配负责人
curl -s -X PUT http://localhost:3456/api/v1/tasks/{task_id}/assignees \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"user_id": 2}'

# 获取负责人
curl -s http://localhost:3456/api/v1/tasks/{task_id}/assignees \
  -H "Authorization: Bearer $TOKEN"

信息查询

# 服务信息(版本、功能开关)
curl -s http://localhost:3456/api/v1/info -H "Authorization: Bearer $TOKEN"

Python 模板

import requests, os

BASE = "http://localhost:3456/api/v1"
TOKEN_FILE = os.path.join(os.getenv("AGENT_WORKSPACE", "."), "config", ".vikunja-token")

def get_token():
    if os.getenv("VIKUNJA_TOKEN"):
        return os.getenv("VIKUNJA_TOKEN")
    with open(TOKEN_FILE) as f:
        return f.read().strip()

def headers():
    return {"Authorization": f"Bearer {get_token()}", "Content-Type": "application/json"}

def create_task(project_id, title, **kw):
    return requests.put(f"{BASE}/projects/{project_id}/tasks",
                        json={"title": title, **kw}, headers=headers()).json()

def update_task(task_id, **kw):
    return requests.post(f"{BASE}/tasks/{task_id}", json=kw, headers=headers()).json()

def search_tasks(q):
    return requests.get(f"{BASE}/tasks", params={"s": q}, headers=headers()).json()

已知坑

  1. 创建任务用 PUT /projects/{id}/tasks,不是 POST
  2. 更新任务用 POST /tasks/{id},不是 PUT(PUT 报 405)
  3. 评论字段是 comment,不是 text
  4. 批量创建 POST /tasks/bulk 文档有但实测不通,循环单条操作代替

Agent Rules

  • 先尝试从 VIKUNJA_TOKEN 环境变量读取 token;无则读 $AGENT_WORKSPACE/config/.vikunja-token
  • Token 不硬编码,运行时从磁盘或环境变量读取
  • 日志只含 metadata(操作类型、数量),无 token 值
  • Token 文件权限 600
  • Token 泄露后:重新 login 获取新 token 存入文件
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install vikunja-usage
  3. After installation, invoke the skill by name or use /vikunja-usage
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
- Updated description to clarify supported features in Chinese and mention multi-agent token support. - No functional or code logic changes; documentation only. - No API changes. Usage, security, and workflow are unchanged.
v1.0.1
- Token 文件路径从 `$AGENT_WORKSPACE/.vikunja-token` 改为 `$AGENT_WORKSPACE/config/.vikunja-token` - 所有相关的 Bash/Python 示例、文档说明同步为新 token 文件目录 - 无功能变更,仅路径与文档更新 - 继续支持 per-agent 独立 token 和多 agent 并发安全
v1.0.0
Initial release of Vikunja task manager skill. - Supports creating and managing projects, tasks, labels, comments, and assignees via Vikunja REST API v1 at localhost:3456 - Task lookup, search, filtering, and done-toggle supported - Reads per-agent token from VIKUNJA_TOKEN env or $AGENT_WORKSPACE/.vikunja-token (multi-agent safe) - Requires curl; Python usage examples included - Agent rules ensure no token hardcoding and secure token storage (permission 600)
Metadata
Slug vikunja-usage
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Vikunja Usage?

任务管理工具:通过 Vikunja REST API v1 创建项目、任务、标签和评论,支持任务搜索、过滤、完成状态切换。Requires: curl。读取 $VIKUNJA_TOKEN 环境变量或 $AGENT_WORKSPACE/config/.vikunja-token 文件获取 token,支持多 agent。 It is an AI Agent Skill for Claude Code / OpenClaw, with 74 downloads so far.

How do I install Vikunja Usage?

Run "/install vikunja-usage" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Vikunja Usage free?

Yes, Vikunja Usage is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Vikunja Usage support?

Vikunja Usage is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Vikunja Usage?

It is built and maintained by AxelHu (@axelhu); the current version is v1.0.2.

💬 Comments