deepvista-cli 4.1.0__tar.gz → 4.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. deepvista_cli-4.2.1/.release-please-manifest.json +3 -0
  2. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/CHANGELOG.md +14 -0
  3. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/PKG-INFO +1 -1
  4. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/client/http.py +20 -0
  5. deepvista_cli-4.2.1/deepvista_cli/commands/__init__.py +94 -0
  6. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/auth.py +23 -8
  7. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/card.py +71 -0
  8. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/project.py +45 -23
  9. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/tasks.py +47 -35
  10. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/main.py +1 -1
  11. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/install.sh +5 -11
  12. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  13. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/pyproject.toml +1 -1
  14. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/SKILL.md +1 -1
  15. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/notes.md +2 -0
  16. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/vistabase-card.md +6 -1
  17. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/uv.lock +1 -1
  18. deepvista_cli-4.1.0/.release-please-manifest.json +0 -3
  19. deepvista_cli-4.1.0/deepvista_cli/commands/__init__.py +0 -55
  20. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.claude-plugin/marketplace.json +0 -0
  21. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.github/workflows/ci.yml +0 -0
  22. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.github/workflows/publish.yml +0 -0
  23. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.github/workflows/release-please.yml +0 -0
  24. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.gitignore +0 -0
  25. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/.pre-commit-config.yaml +0 -0
  26. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/CLAUDE.md +0 -0
  27. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/CONTRIBUTING.md +0 -0
  28. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/LICENSE +0 -0
  29. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/README.md +0 -0
  30. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/__init__.py +0 -0
  31. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/auth/__init__.py +0 -0
  32. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/auth/callback_server.py +0 -0
  33. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/auth/login.py +0 -0
  34. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/auth/tokens.py +0 -0
  35. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/client/__init__.py +0 -0
  36. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/client/origin.py +0 -0
  37. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/agents.py +0 -0
  38. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/chat.py +0 -0
  39. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/config.py +0 -0
  40. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/notes.py +0 -0
  41. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/schedule.py +0 -0
  42. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/session.py +0 -0
  43. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/skill.py +0 -0
  44. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/commands/upgrade.py +0 -0
  45. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/config.py +0 -0
  46. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/output/__init__.py +0 -0
  47. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/output/formatter.py +0 -0
  48. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/resources/__init__.py +0 -0
  49. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/resources/workflow_host_runtime.md +0 -0
  50. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/session_note.py +0 -0
  51. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/skill_catalog.py +0 -0
  52. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/utils.py +0 -0
  53. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/deepvista_cli/workflow_doc.py +0 -0
  54. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/docs/assets/deepvista-banner.png +0 -0
  55. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/install.ps1 +0 -0
  56. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/README.md +0 -0
  57. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/README.md +0 -0
  58. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/commands/deepvista.md +0 -0
  59. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/commands/refresh-skills.md +0 -0
  60. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/hooks/hooks.json +0 -0
  61. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-agent-sync.sh +0 -0
  62. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-session-end.sh +0 -0
  63. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-session-start.sh +0 -0
  64. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-session-turn.sh +0 -0
  65. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-skill-url.py +0 -0
  66. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/scripts/deepvista-sync.sh +0 -0
  67. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/skills/.gitignore +0 -0
  68. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/plugins/claude-code/skills/install-deepvista-cli/SKILL.md +0 -0
  69. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/release-please-config.json +0 -0
  70. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/scripts/check_plugin_version.py +0 -0
  71. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/chat.md +0 -0
  72. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/openclaw.md +0 -0
  73. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/project.md +0 -0
  74. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/session.md +0 -0
  75. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/shared.md +0 -0
  76. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/skill-analyze-notes.md +0 -0
  77. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/skill-create-from-note.md +0 -0
  78. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/skill-import-files.md +0 -0
  79. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/skill-research-to-skill.md +0 -0
  80. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/skill.md +0 -0
  81. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/deepvista/reference/tasks.md +0 -0
  82. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/skills/dv-workflow/SKILL.md +0 -0
  83. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/__init__.py +0 -0
  84. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_agent_id_tagging.py +0 -0
  85. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_card_comment_commands.py +0 -0
  86. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_entry_points.py +0 -0
  87. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_http_client_retry.py +0 -0
  88. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_project_commands.py +0 -0
  89. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_schedule_commands.py +0 -0
  90. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_session_note_format.py +0 -0
  91. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_skill_catalog.py +0 -0
  92. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_skill_commands.py +0 -0
  93. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_tasks_commands.py +0 -0
  94. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/tests/test_workflow_doc_phases.py +0 -0
  95. {deepvista_cli-4.1.0 → deepvista_cli-4.2.1}/uninstall.sh +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "4.2.1"
3
+ }
@@ -46,6 +46,20 @@ users what's new between the version they have installed and the latest release.
46
46
  adopts a pre-existing server-side row instead of failing when the local
47
47
  file is missing.
48
48
 
49
+ ## [4.2.1](https://github.com/DeepVista-AI/deepvista-cli/compare/v4.2.0...v4.2.1) (2026-07-22)
50
+
51
+
52
+ ### Documentation
53
+
54
+ * **DV-1650:** document card upload + note image embed ([#214](https://github.com/DeepVista-AI/deepvista-cli/issues/214)) ([b754b99](https://github.com/DeepVista-AI/deepvista-cli/commit/b754b99d3a5697ba7803aa162fd56d03196cee00))
55
+
56
+ ## [4.2.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v4.1.0...v4.2.0) (2026-07-20)
57
+
58
+
59
+ ### Features
60
+
61
+ * **DV-1563,DV-1564,DV-1646,DV-1650:** CLI — per-project daemon lock, slug support, welcome copy, card upload ([#212](https://github.com/DeepVista-AI/deepvista-cli/issues/212)) ([231d4ad](https://github.com/DeepVista-AI/deepvista-cli/commit/231d4ad724ffee18760bb59b7bf5203d63e5faef))
62
+
49
63
  ## [4.1.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v4.0.0...v4.1.0) (2026-07-16)
50
64
 
51
65
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepvista-cli
3
- Version: 4.1.0
3
+ Version: 4.2.1
4
4
  Summary: CLI for DeepVista — chat, notes, skills, and memory from your terminal.
5
5
  Project-URL: Homepage, https://deepvista.ai
6
6
  Project-URL: Repository, https://github.com/DeepVista-AI/deepvista-cli
@@ -240,6 +240,26 @@ class DeepVistaClient:
240
240
  except Exception:
241
241
  return {"error": resp.text, "status_code": resp.status_code, "_status_code": resp.status_code}
242
242
 
243
+ def put_bytes(self, url: str, data: bytes, headers: dict[str, str]) -> None:
244
+ """PUT raw bytes to an absolute (pre-signed) URL — GCS uploads (DV-1650).
245
+
246
+ Bypasses the API base URL and auth headers: the signature embedded in
247
+ the URL is the auth, and the storage service requires exactly the
248
+ headers returned alongside it. Errors exit like any API call.
249
+ """
250
+ if self.config.verbose:
251
+ click.echo(f">>> PUT {url} ({len(data)} bytes)", err=True)
252
+ if self.config.dry_run:
253
+ click.echo(json.dumps({"dry_run": True, "method": "PUT", "url": url, "bytes": len(data)}), err=True)
254
+ sys.exit(0)
255
+ try:
256
+ resp = self._call_with_retry(lambda: httpx.put(url, content=data, headers=headers, timeout=120))
257
+ except (httpx.ConnectError, httpx.TimeoutException) as exc:
258
+ self._handle_network_error(exc)
259
+ self._log_response(resp)
260
+ if resp.status_code >= 400:
261
+ self._handle_error(resp)
262
+
243
263
  def patch(self, path: str, body: dict | None = None) -> Any:
244
264
  """HTTP PATCH, returns parsed JSON."""
245
265
  return self._request("PATCH", path, body=body)
@@ -0,0 +1,94 @@
1
+ """CLI command groups — auth, vistabase, skill, notes, chat."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import re
6
+ import sys
7
+ from collections.abc import Callable
8
+
9
+ import click
10
+
11
+ from deepvista_cli.output.formatter import output_error
12
+
13
+ _UUID_RE = re.compile(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
14
+
15
+
16
+ def looks_like_uuid(value: str) -> bool:
17
+ return bool(_UUID_RE.fullmatch(value))
18
+
19
+
20
+ def resolve_project_ref(ctx: click.Context, ref: str) -> str:
21
+ """Resolve a project reference — UUID or slug (DV-1564) — to the canonical UUID.
22
+
23
+ UUIDs pass through without a lookup. Anything else is treated as a slug
24
+ and matched against ``GET /projects``; exits with a validation error when
25
+ no accessible project carries it. Canonicalizing to the UUID keeps every
26
+ project-keyed artifact (persisted profile config, machine cache files,
27
+ run locks) stable regardless of how the user spelled the project.
28
+ """
29
+ if looks_like_uuid(ref):
30
+ return ref
31
+ raw = ctx.obj._client.get("/projects")
32
+ projects = raw if isinstance(raw, list) else raw.get("projects", []) if isinstance(raw, dict) else []
33
+ for project in projects:
34
+ if project.get("slug") == ref or project.get("id") == ref:
35
+ return str(project["id"])
36
+ output_error(
37
+ 3,
38
+ f"Project '{ref}' not found or not accessible",
39
+ "Run `deepvista project list` to see available projects (id and slug).",
40
+ )
41
+ raise SystemExit(3)
42
+
43
+
44
+ def project_option[F: Callable](func: F) -> F:
45
+ """Add a per-command ``--project <id|slug>`` override.
46
+
47
+ Use together with :func:`apply_project_override` at the top of the command
48
+ body. The override takes precedence over the persisted working project /
49
+ global ``--project`` flag for this single invocation only.
50
+ """
51
+ return click.option(
52
+ "--project",
53
+ "project_override",
54
+ default=None,
55
+ help="Scope this command to a project id or slug (overrides the working project for this call only).",
56
+ )(func)
57
+
58
+
59
+ def apply_project_override(ctx: click.Context, project_override: str | None) -> None:
60
+ """Apply a per-command ``--project`` value to the resolved config.
61
+
62
+ Mutating ``ctx.obj.project_id`` is sufficient because the HTTP client holds
63
+ the *same* ``CLIConfig`` object and reads ``project_id`` lazily when it
64
+ builds request headers, so the override flows through to ``X-Project-Id``
65
+ and to emitted web links without touching every callsite. Slugs pass
66
+ through as-is — the backend resolves slug-or-UUID in the header (DV-1564).
67
+ """
68
+ if project_override:
69
+ ctx.obj.project_id = project_override
70
+
71
+
72
+ def resolve_content(content: str | None, content_file: str | None) -> str | None:
73
+ """Resolve content from ``--content`` or ``--content-file``.
74
+
75
+ ``--content-file`` takes precedence when provided. Use ``-`` to read from
76
+ stdin. Returns the resolved content string, or *None* if neither option was
77
+ supplied.
78
+ """
79
+ if content_file is not None:
80
+ if content_file == "-":
81
+ return sys.stdin.read()
82
+ try:
83
+ with open(content_file, encoding="utf-8") as fh:
84
+ return fh.read()
85
+ except UnicodeDecodeError:
86
+ output_error(
87
+ 3,
88
+ "Content file is not UTF-8 text",
89
+ f"{content_file} looks binary — use `deepvista card upload {content_file}` "
90
+ "to attach it as a file card instead (DV-1650).",
91
+ )
92
+ except OSError as exc:
93
+ output_error(4, "Cannot read content file", str(exc))
94
+ return content
@@ -24,17 +24,28 @@ def auth_group() -> None:
24
24
 
25
25
 
26
26
  def _print_next_steps(project_id: str | None = None) -> None:
27
- """Print the post-login next step on stderr (DV-1493)."""
27
+ """Print the post-login welcome on stderr (DV-1493, DV-1646).
28
+
29
+ Short command + description pairs keep the copy scannable; the
30
+ machine-readable login JSON on stdout is untouched.
31
+ """
28
32
  if project_id:
29
- command = "deepvista tasks run"
30
- description = "kick off the task daemon for your current project"
33
+ steps = [("deepvista tasks run", "start the task daemon for your current project")]
31
34
  else:
32
- command = "deepvista tasks run --project <project_id>"
33
- description = "kick off the task daemon for a project"
35
+ steps = [
36
+ ("deepvista project use <id|slug>", "pick the project to work in"),
37
+ ("deepvista tasks run", "start its task daemon"),
38
+ ]
34
39
 
35
40
  click.echo("\n What's next?", err=True)
36
- click.echo(f" {click.style(command, fg='cyan', bold=True)}", err=True)
37
- click.echo(f" {click.style(description, dim=True)}", err=True)
41
+ for command, description in steps:
42
+ click.echo(f" {click.style(command, fg='cyan', bold=True)}", err=True)
43
+ click.echo(f" {click.style(description, dim=True)}", err=True)
44
+
45
+ click.echo(
46
+ f"\n New here? Open your AI agent and say: {click.style('Help me get started with DeepVista.', italic=True)}",
47
+ err=True,
48
+ )
38
49
 
39
50
 
40
51
  @auth_group.command("login")
@@ -77,7 +88,11 @@ def auth_login(ctx: click.Context, code: str | None, dry_run: bool) -> None:
77
88
  "user_id": tokens.user_id,
78
89
  }
79
90
  format_output(result, ctx.obj.output_format)
80
- click.echo(f" Logged in as {tokens.email or tokens.user_id}", err=True)
91
+ click.echo(
92
+ f"\n {click.style('✓', fg='green', bold=True)} Logged in as "
93
+ f"{click.style(tokens.email or tokens.user_id, bold=True)}",
94
+ err=True,
95
+ )
81
96
  _print_next_steps(ctx.obj.project_id)
82
97
 
83
98
 
@@ -11,6 +11,7 @@ Endpoints:
11
11
  POST /get_context_cards -> list / search
12
12
  POST /get_context_card -> get by id
13
13
  POST /create_context_card -> create
14
+ POST /attachments/signed-upload-url -> presigned PUT for `card upload` (DV-1650)
14
15
  POST /update_context_card -> update
15
16
  POST /edit_context_card -> targeted string replacement (file-ops Edit)
16
17
  POST /search_context_cards -> hybrid tsvector + embedding content search
@@ -55,6 +56,10 @@ CARD_TYPES = [
55
56
 
56
57
  CARD_COLUMNS = ["id", "type", "title", "display_status", "updated_at"]
57
58
 
59
+ # Mirrors the backend's cap on /attachments/signed-upload-url so oversize
60
+ # uploads fail fast without a round trip.
61
+ MAX_UPLOAD_BYTES = 100 * 1024 * 1024
62
+
58
63
  COMMENT_COLUMNS = ["id", "commenter_type", "commenter_name", "comment", "created_at"]
59
64
 
60
65
 
@@ -227,6 +232,72 @@ def card_create(
227
232
  )
228
233
 
229
234
 
235
+ @card_group.command("upload")
236
+ @click.argument("file_path", type=click.Path(exists=True, dir_okay=False, readable=True))
237
+ @click.option("--content-type", default=None, help="MIME type (default: guessed from the file name).")
238
+ @click.option("--dry-run", is_flag=True, default=False, help="Preview what would happen without making any changes.")
239
+ @project_option
240
+ @click.pass_context
241
+ def card_upload(
242
+ ctx: click.Context,
243
+ file_path: str,
244
+ content_type: str | None,
245
+ dry_run: bool,
246
+ project_override: str | None,
247
+ ) -> None:
248
+ """Upload a file (binary OK) as a `file` context card (DV-1650).
249
+
250
+ Requests a presigned upload URL, PUTs the raw bytes to storage, and the
251
+ backend mints the `file` card — title = file name, with `url`,
252
+ `file_type`, and `uploaded_at` populated. Use this instead of
253
+ `card create --content-file` for anything that isn't UTF-8 text.
254
+
255
+ > [!CAUTION] This is a write command — confirm with the user before executing.
256
+ """
257
+ import mimetypes
258
+ from pathlib import Path as _Path
259
+
260
+ apply_project_override(ctx, project_override)
261
+ path = _Path(file_path)
262
+ size = path.stat().st_size
263
+ if size > MAX_UPLOAD_BYTES:
264
+ output_error(
265
+ 3,
266
+ f"File exceeds the {MAX_UPLOAD_BYTES // (1024 * 1024)} MB upload limit",
267
+ f"{path} is {size} bytes.",
268
+ )
269
+ resolved_type = content_type or mimetypes.guess_type(path.name)[0] or "application/octet-stream"
270
+ body = {"file_name": path.name, "file_size": size, "content_type": resolved_type}
271
+
272
+ if dry_run:
273
+ format_output(
274
+ {"dry_run": True, "would": "upload file and create a file card", "payload": body},
275
+ ctx.obj.output_format,
276
+ entity_type="card",
277
+ base_url=ctx.obj.auth_url,
278
+ project_id=ctx.obj.project_id,
279
+ )
280
+ return
281
+
282
+ grant = _client(ctx).post("/attachments/signed-upload-url", body)
283
+ _client(ctx).put_bytes(grant["signedUrl"], path.read_bytes(), grant.get("headers") or {})
284
+ result = {
285
+ "uploaded": path.name,
286
+ "bytes": size,
287
+ "file_type": resolved_type,
288
+ "url": grant.get("gsUrl"),
289
+ "card": "file card created by the backend (title = file name)",
290
+ }
291
+ format_output(
292
+ result,
293
+ ctx.obj.output_format,
294
+ title="Uploaded file card",
295
+ entity_type="card",
296
+ base_url=ctx.obj.auth_url,
297
+ project_id=ctx.obj.project_id,
298
+ )
299
+
300
+
230
301
  @card_group.command("update")
231
302
  @click.argument("card_id")
232
303
  @click.option("--title", default=None, help="New title.")
@@ -16,7 +16,6 @@ Resolution order for the working project (highest wins):
16
16
  Endpoints:
17
17
  GET /projects -> list owned + shared projects
18
18
  GET /projects/me -> the resolved/default project
19
- GET /projects/{id} -> a single project's metadata
20
19
  """
21
20
 
22
21
  from __future__ import annotations
@@ -31,7 +30,7 @@ from deepvista_cli.config import (
31
30
  )
32
31
  from deepvista_cli.output.formatter import format_output, output_error
33
32
 
34
- PROJECT_COLUMNS = ["id", "name", "role"]
33
+ PROJECT_COLUMNS = ["id", "slug", "name", "role"]
35
34
 
36
35
 
37
36
  def _client(ctx: click.Context) -> DeepVistaClient:
@@ -53,6 +52,19 @@ def _projects(ctx: click.Context) -> list[dict]:
53
52
  return []
54
53
 
55
54
 
55
+ def _match_project(projects: list[dict], ref: str) -> dict | None:
56
+ """Find a project by id or slug (DV-1564)."""
57
+ return next((p for p in projects if p.get("id") == ref or (p.get("slug") and p.get("slug") == ref)), None)
58
+
59
+
60
+ def _project_not_found(ref: str) -> None:
61
+ output_error(
62
+ EXIT_VALIDATION_ERROR,
63
+ f"Project '{ref}' not found or not accessible",
64
+ detail="Run `deepvista project list` to see available projects (id and slug).",
65
+ )
66
+
67
+
56
68
  def _project_role(project: dict) -> str | None:
57
69
  """Best-effort role for a project: explicit permission, else owner/shared."""
58
70
  permission = project.get("permission")
@@ -83,7 +95,12 @@ def _slim_project(project: dict) -> dict:
83
95
 
84
96
  Keeps the ``id`` so the formatter still attaches a ``/project/{id}`` link.
85
97
  """
86
- slim: dict = {"id": project.get("id"), "name": project.get("name"), "role": _project_role(project)}
98
+ slim: dict = {
99
+ "id": project.get("id"),
100
+ "slug": project.get("slug"),
101
+ "name": project.get("name"),
102
+ "role": _project_role(project),
103
+ }
87
104
  for key in _SLIM_OPTIONAL_FIELDS:
88
105
  if project.get(key) is not None:
89
106
  slim[key] = project[key]
@@ -94,11 +111,11 @@ def _slim_project(project: dict) -> dict:
94
111
  def project_group() -> None:
95
112
  """Inspect and switch the CLI's working project.
96
113
 
97
- Pick a working project once with `project use <id>`; every subcommand then
98
- scopes to it (sends `X-Project-Id` and emits `/project/{id}/...` links).
99
- Override per-invocation with the global `--project <id>` flag or the
100
- `DEEPVISTA_PROJECT_ID` env var. `project clear` falls back to the backend
101
- default.
114
+ Pick a working project once with `project use <id|slug>`; every subcommand
115
+ then scopes to it (sends `X-Project-Id` and emits `/project/{id}/...`
116
+ links). Override per-invocation with the global `--project <id|slug>` flag
117
+ or the `DEEPVISTA_PROJECT_ID` env var. `project clear` falls back to the
118
+ backend default.
102
119
  """
103
120
 
104
121
 
@@ -136,13 +153,19 @@ def project_current(ctx: click.Context, full: bool) -> None:
136
153
 
137
154
 
138
155
  @project_group.command("show")
139
- @click.argument("project_id", required=False)
156
+ @click.argument("project_ref", required=False)
140
157
  @click.option("--full", is_flag=True, default=False, help="Show the raw project object (tags, starters, …).")
141
158
  @click.pass_context
142
- def project_show(ctx: click.Context, project_id: str | None, full: bool) -> None:
143
- """Show metadata for a project (defaults to the resolved current project)."""
144
- if project_id:
145
- data = _client(ctx).get(f"/projects/{project_id}")
159
+ def project_show(ctx: click.Context, project_ref: str | None, full: bool) -> None:
160
+ """Show metadata for a project — by id or slug (defaults to the resolved current project)."""
161
+ if project_ref:
162
+ # There is no GET /projects/{id}; resolve the ref (id or slug, DV-1564)
163
+ # against the projects list, which returns the full project object.
164
+ match = _match_project(_projects(ctx), project_ref)
165
+ if match is None:
166
+ _project_not_found(project_ref)
167
+ return
168
+ data = match
146
169
  else:
147
170
  data = _client(ctx).get("/projects/me")
148
171
  if not full and isinstance(data, dict):
@@ -151,27 +174,26 @@ def project_show(ctx: click.Context, project_id: str | None, full: bool) -> None
151
174
 
152
175
 
153
176
  @project_group.command("use")
154
- @click.argument("project_id")
177
+ @click.argument("project_ref")
155
178
  @click.pass_context
156
- def project_use(ctx: click.Context, project_id: str) -> None:
179
+ def project_use(ctx: click.Context, project_ref: str) -> None:
157
180
  """Set the working project for this profile after validating membership.
158
181
 
159
- Persists ``project_id`` in the active profile. This is client-side scoping
182
+ PROJECT_REF is the project's id or slug (DV-1564); the canonical UUID is
183
+ what gets persisted in the active profile. This is client-side scoping
160
184
  only — it does not change the backend's per-user default project.
161
185
  """
162
- projects = _projects(ctx)
163
- match = next((p for p in projects if p.get("id") == project_id), None)
186
+ match = _match_project(_projects(ctx), project_ref)
164
187
  if match is None:
165
- output_error(
166
- EXIT_VALIDATION_ERROR,
167
- f"Project {project_id} not found or not accessible",
168
- detail="Run `deepvista project list` to see available projects.",
169
- )
188
+ _project_not_found(project_ref)
189
+ return
170
190
 
191
+ project_id = str(match.get("id"))
171
192
  set_working_project(ctx.obj.profile, project_id)
172
193
  ctx.obj.project_id = project_id
173
194
  result = {
174
195
  "working_project": project_id,
196
+ "slug": match.get("slug"),
175
197
  "name": match.get("name"),
176
198
  "profile": ctx.obj.profile,
177
199
  }
@@ -11,8 +11,9 @@ and run them:
11
11
 
12
12
  Polling (DV-1079): ``run`` polls in the foreground by default (--poll-interval,
13
13
  bounded by --total-time when given); --run-once does a single claim/execute
14
- pass, which is what the cron entry installed by ``setup`` uses. A PID lock file
15
- allows only one ``tasks run`` per machine at a time. Headless runs execute
14
+ pass, which is what the cron entry installed by ``setup`` uses. A per-project
15
+ PID lock file allows only one ``tasks run`` per project at a time; daemons for
16
+ different projects coexist on one machine (DV-1563). Headless runs execute
16
17
  concurrently up to --max-parallel (default 5).
17
18
  """
18
19
 
@@ -35,6 +36,7 @@ import click
35
36
  from deepvista_cli.auth.tokens import get_valid_token
36
37
  from deepvista_cli.client.http import DeepVistaClient
37
38
  from deepvista_cli.client.origin import detect_agent_tool
39
+ from deepvista_cli.commands import resolve_project_ref
38
40
  from deepvista_cli.commands.agents import (
39
41
  AGENTS_DIR,
40
42
  MACHINES_DIR,
@@ -67,8 +69,8 @@ DEFAULT_MAX_PARALLEL_TASKS = 5
67
69
  # Idle polls between heartbeat lines in default (non-verbose) mode (~5 min at 10s).
68
70
  IDLE_HEARTBEAT_POLLS = 30
69
71
 
70
- # Single-instance lock for `tasks run` (DV-1079) — holds the owner PID.
71
- RUN_LOCK_PATH = CONFIG_DIR / "task_queue.run.lock"
72
+ # Directory holding the per-project `tasks run` locks (DV-1079, DV-1563).
73
+ RUN_LOCK_DIR = CONFIG_DIR
72
74
 
73
75
 
74
76
  # ---------------------------------------------------------------------------
@@ -140,33 +142,40 @@ def _pid_alive(pid: int) -> bool:
140
142
  return True
141
143
 
142
144
 
143
- def _read_lock_pid() -> int | None:
145
+ def _run_lock_path(project_id: str) -> Path:
146
+ """Lock file for a project's `tasks run` daemon — holds the owner PID."""
147
+ return RUN_LOCK_DIR / f"task_queue.run.{project_id}.lock"
148
+
149
+
150
+ def _read_lock_pid(lock_path: Path) -> int | None:
144
151
  try:
145
- return int(RUN_LOCK_PATH.read_text().strip())
152
+ return int(lock_path.read_text().strip())
146
153
  except (OSError, ValueError):
147
154
  return None
148
155
 
149
156
 
150
- def _acquire_run_lock() -> bool:
151
- """Take the machine-wide single-instance lock for `tasks run` (DV-1079).
157
+ def _acquire_run_lock(lock_path: Path) -> bool:
158
+ """Take the per-project single-instance lock for `tasks run` (DV-1079, DV-1563).
152
159
 
153
- Overlapping pollers would double-claim the queue, so only one `run` may
154
- be active at a time — a foreground poller and a cron tick included. A
155
- lock whose owner PID is dead (crash, reboot) is stale and reclaimed.
160
+ Overlapping pollers would double-claim a project's queue, so only one
161
+ `run` may be active per project at a time — a foreground poller and a
162
+ cron tick included. Daemons for *different* projects hold different locks
163
+ and coexist on one machine. A lock whose owner PID is dead (crash,
164
+ reboot) is stale and reclaimed.
156
165
  """
157
- pid = _read_lock_pid()
166
+ pid = _read_lock_pid(lock_path)
158
167
  if pid is not None and pid != os.getpid() and _pid_alive(pid):
159
168
  return False
160
- RUN_LOCK_PATH.parent.mkdir(parents=True, exist_ok=True)
161
- RUN_LOCK_PATH.write_text(str(os.getpid()))
169
+ lock_path.parent.mkdir(parents=True, exist_ok=True)
170
+ lock_path.write_text(str(os.getpid()))
162
171
  return True
163
172
 
164
173
 
165
- def _release_run_lock() -> None:
166
- if _read_lock_pid() != os.getpid():
174
+ def _release_run_lock(lock_path: Path) -> None:
175
+ if _read_lock_pid(lock_path) != os.getpid():
167
176
  return
168
177
  try:
169
- RUN_LOCK_PATH.unlink()
178
+ lock_path.unlink()
170
179
  except OSError:
171
180
  pass
172
181
 
@@ -596,17 +605,17 @@ def _find_registered_agent_for_project(project_id: str) -> str | None:
596
605
 
597
606
 
598
607
  def _resolve_working_project(ctx: click.Context, project_override: str | None = None) -> str | None:
599
- """Return the project ``tasks run`` should scope to.
608
+ """Return the project ``tasks run`` should scope to, as a canonical UUID.
600
609
 
601
610
  Resolution order: per-command ``--project`` → global working project
602
611
  (``project use`` / global ``--project`` / ``DEEPVISTA_PROJECT_ID``) →
603
- backend default via ``GET /projects/me``.
612
+ backend default via ``GET /projects/me``. Slugs are resolved to the
613
+ project UUID (DV-1564) so machine cache files and run locks stay keyed
614
+ consistently.
604
615
  """
605
- if project_override:
606
- return project_override
607
- profile_project = getattr(ctx.obj, "project_id", None)
608
- if profile_project:
609
- return profile_project
616
+ ref = project_override or getattr(ctx.obj, "project_id", None)
617
+ if ref:
618
+ return resolve_project_ref(ctx, ref)
610
619
  try:
611
620
  data = _client(ctx).get("/projects/me")
612
621
  except SystemExit:
@@ -924,7 +933,7 @@ def _claim_and_submit_all(
924
933
  "--project",
925
934
  "project_id",
926
935
  default=None,
927
- help="Scope to this project (overrides the working project for this call only).",
936
+ help="Scope to this project — id or slug (overrides the working project for this call only).",
928
937
  )
929
938
  @click.option(
930
939
  "--run-once",
@@ -992,19 +1001,21 @@ def tasks_run(
992
1001
  unset). --run-once does a single pass and exits; the cron entry installed
993
1002
  by ``tasks setup`` uses it.
994
1003
 
995
- Only one ``tasks run`` may be active per machine — concurrent
996
- invocations exit with an error instead of double-claiming work.
1004
+ Only one ``tasks run`` may be active per project — concurrent
1005
+ invocations for the same project exit with an error instead of
1006
+ double-claiming work. Daemons for different projects coexist (DV-1563).
997
1007
  """
998
- if not _acquire_run_lock():
1008
+ project_names: dict[str, str] = {}
1009
+ working_project = _resolve_working_project(ctx, project_id)
1010
+
1011
+ run_lock_path = _run_lock_path(working_project) if working_project else None
1012
+ if run_lock_path is not None and not _acquire_run_lock(run_lock_path):
999
1013
  output_error(
1000
1014
  2,
1001
- "Another `tasks run` is already active on this machine",
1002
- f"Stop it first or wait for it to finish (lock: {RUN_LOCK_PATH}, pid: {_read_lock_pid()}).",
1015
+ f"Another `tasks run` is already active for project {working_project}",
1016
+ f"Stop it first or wait for it to finish (lock: {run_lock_path}, pid: {_read_lock_pid(run_lock_path)}).",
1003
1017
  )
1004
1018
  raise SystemExit(2)
1005
-
1006
- project_names: dict[str, str] = {}
1007
- working_project = _resolve_working_project(ctx, project_id)
1008
1019
  agents: list[tuple[str, str | None]]
1009
1020
  if agent_type:
1010
1021
  # Explicit agent filter — single-agent mode (backward-compatible).
@@ -1026,7 +1037,7 @@ def tasks_run(
1026
1037
  output_error(
1027
1038
  3,
1028
1039
  "No working project to poll",
1029
- "Run `deepvista project use <id>` or pass `--project <id>`.",
1040
+ "Run `deepvista project use <id|slug>` or pass `--project <id|slug>`.",
1030
1041
  )
1031
1042
  raise SystemExit(3)
1032
1043
  agents, project_names = _ensure_agents_for_projects(ctx, project_ids={working_project})
@@ -1164,7 +1175,8 @@ def tasks_run(
1164
1175
  raise SystemExit(130) from None
1165
1176
  finally:
1166
1177
  executor.shutdown()
1167
- _release_run_lock()
1178
+ if run_lock_path is not None:
1179
+ _release_run_lock(run_lock_path)
1168
1180
 
1169
1181
 
1170
1182
  TASK_CARD_COLUMNS = ["id", "status", "title", "agent_id", "created_at"]
@@ -63,7 +63,7 @@ class _RootGroup(click.Group):
63
63
  "--project",
64
64
  "project_id",
65
65
  default=None,
66
- help="Scope this invocation to a project id (overrides the profile working project / DEEPVISTA_PROJECT_ID).",
66
+ help="Scope this invocation to a project id or slug (overrides the working project / DEEPVISTA_PROJECT_ID).",
67
67
  )
68
68
  @click.pass_context
69
69
  def cli(
@@ -197,18 +197,12 @@ else
197
197
  fi
198
198
 
199
199
  echo ""
200
- echo "==> DeepVista Claude Code plugin"
200
+ echo "==> One last step — connect your AI agent"
201
201
  echo ""
202
- echo " Inside Claude Code, run:"
202
+ echo " Claude Code: /plugin marketplace add DeepVista-AI/deepvista-cli"
203
+ echo " /plugin install deepvista@deepvista-ai"
203
204
  echo ""
204
- echo " /plugin marketplace add DeepVista-AI/deepvista-cli"
205
- echo " /plugin install deepvista@deepvista-ai"
205
+ echo " Other agents: https://github.com/DeepVista-AI/deepvista-cli#as-a-claude-code-plugin"
206
206
  echo ""
207
- echo " Using a different AI agent? Paste this prompt:"
208
- echo ""
209
- echo " Help me install the deepvista plugin for Claude Code: https://github.com/DeepVista-AI/deepvista-cli#as-a-claude-code-plugin"
210
- echo ""
211
- echo "DeepVista is ready. Open your AI agent and say:"
212
- echo ""
213
- echo " Help me get started with DeepVista."
207
+ echo "✓ DeepVista is ready. Open your AI agent and say: \"Help me get started with DeepVista.\""
214
208
  echo ""
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepvista",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "description": "Remote-managed skill catalog from DeepVista. Auto-syncs thin stubs into the plugin's skills dir on SessionStart; full bodies are lazy-loaded at invocation time.",
5
5
  "author": {
6
6
  "name": "DeepVista AI",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deepvista-cli"
3
- version = "4.1.0"
3
+ version = "4.2.1"
4
4
  description = "CLI for DeepVista — chat, notes, skills, and memory from your terminal."
5
5
  readme = "README.md"
6
6
  license = { text = "Apache-2.0" }
@@ -47,7 +47,7 @@ other reference file assumes you know it.
47
47
  | `deepvista notes` | taking a note the user **explicitly asked to record**, listing / updating / deleting notes, quick-capture of a single-line fact | [notes.md](reference/notes.md) |
48
48
  | `deepvista session` | recording an agent conversation transcript as a rolling `type=session` card via the `init` / `tick` / `finalize` hook lifecycle | [session.md](reference/session.md) |
49
49
  | `deepvista schedule` | activating / deactivating / listing the opt-in recurring daily-planning job | `deepvista schedule --help` |
50
- | `deepvista card` (alias: `vistabase`) | creating / searching / pinning / archiving / grepping knowledge base cards across any type (person, topic, file, note, todo, etc.), version history (`history` / `diff` / `restore`), and entity re-indexing (`index`) | [vistabase-card.md](reference/vistabase-card.md) |
50
+ | `deepvista card` (alias: `vistabase`) | creating / searching / pinning / archiving / grepping knowledge base cards across any type (person, topic, file, note, todo, etc.), **uploading an image / video / binary file** (`card upload`), version history (`history` / `diff` / `restore`), and entity re-indexing (`index`) | [vistabase-card.md](reference/vistabase-card.md) |
51
51
  | `deepvista chat` | sending a message to the AI agent, listing / deleting chat sessions, continuing a conversation | [chat.md](reference/chat.md) |
52
52
  | `deepvista skill` | listing, running, **creating new skills**, or **catalog-syncing** (`sync` / `load`) structured Skill workflows | [skill.md](reference/skill.md) |
53
53
  | `deepvista tasks` | running this **Machine**'s dispatched work: `tasks run` polls for tasks (web-chat prompts run headless via `claude -p`, plus queued CLI commands / workflow runs) and `tasks list` shows them | [tasks.md](reference/tasks.md) |
@@ -28,6 +28,8 @@ flag reference.
28
28
 
29
29
  - **Always use `--content-file <absolute-path>`** for anything more than ~200 chars or
30
30
  containing newlines. Never paste large content inline. Pass `-` to read from stdin.
31
+ - **Images/binaries:** notes hold text only — upload with `deepvista card upload <path>`,
32
+ then embed the returned `gs://…` URL in the note body via `![alt](gs://…)` (DV-1650).
31
33
  - Show the app URL after any write: `https://app.deepvista.ai/notes/<id>`
32
34
  - Use `--dry-run` to preview without writing.
33
35
 
@@ -17,7 +17,7 @@ Use [notes.md](notes.md) for note-only ergonomics.
17
17
 
18
18
  ## Commands
19
19
 
20
- `list` · `get` · `create` · `update` · `edit` · `delete`
20
+ `list` · `get` · `create` · `update` · `edit` · `delete` · `upload`
21
21
  `index` · `history` · `diff` · `restore`
22
22
  `comment list|add|edit|delete`
23
23
  `+search` · `+similar` · `+search-content` · `+pin` · `+archive`
@@ -47,6 +47,11 @@ full body via the search_vector + embedding hybrid. Omit the query on
47
47
  regex/exact-match mode exists anymore — for a boolean OR use `websearch_to_tsquery`
48
48
  syntax, e.g. `"TODO OR FIXME"`).
49
49
 
50
+ **`upload <path>`** — the ONLY way to put an image/video/binary into DeepVista: it
51
+ uploads the file and mints a `type=file` card (`card create --content-file` reads UTF-8
52
+ text only and errors on binaries). To show the image in a note, embed the returned
53
+ `gs://…` URL with plain markdown: `![alt](gs://…)` (DV-1650).
54
+
50
55
  **`index`** — queues entity extraction + embedding refresh on unprocessed cards
51
56
  (`--type note` by default). Run after bulk imports or a long offline period.
52
57
 
@@ -56,7 +56,7 @@ wheels = [
56
56
 
57
57
  [[package]]
58
58
  name = "deepvista-cli"
59
- version = "4.1.0"
59
+ version = "4.2.1"
60
60
  source = { editable = "." }
61
61
  dependencies = [
62
62
  { name = "click" },
@@ -1,3 +0,0 @@
1
- {
2
- ".": "4.1.0"
3
- }
@@ -1,55 +0,0 @@
1
- """CLI command groups — auth, vistabase, skill, notes, chat."""
2
-
3
- from __future__ import annotations
4
-
5
- import sys
6
- from collections.abc import Callable
7
-
8
- import click
9
-
10
- from deepvista_cli.output.formatter import output_error
11
-
12
-
13
- def project_option[F: Callable](func: F) -> F:
14
- """Add a per-command ``--project <id>`` override.
15
-
16
- Use together with :func:`apply_project_override` at the top of the command
17
- body. The override takes precedence over the persisted working project /
18
- global ``--project`` flag for this single invocation only.
19
- """
20
- return click.option(
21
- "--project",
22
- "project_override",
23
- default=None,
24
- help="Scope this command to a project id (overrides the working project for this call only).",
25
- )(func)
26
-
27
-
28
- def apply_project_override(ctx: click.Context, project_override: str | None) -> None:
29
- """Apply a per-command ``--project`` value to the resolved config.
30
-
31
- Mutating ``ctx.obj.project_id`` is sufficient because the HTTP client holds
32
- the *same* ``CLIConfig`` object and reads ``project_id`` lazily when it
33
- builds request headers, so the override flows through to ``X-Project-Id``
34
- and to emitted web links without touching every callsite.
35
- """
36
- if project_override:
37
- ctx.obj.project_id = project_override
38
-
39
-
40
- def resolve_content(content: str | None, content_file: str | None) -> str | None:
41
- """Resolve content from ``--content`` or ``--content-file``.
42
-
43
- ``--content-file`` takes precedence when provided. Use ``-`` to read from
44
- stdin. Returns the resolved content string, or *None* if neither option was
45
- supplied.
46
- """
47
- if content_file is not None:
48
- if content_file == "-":
49
- return sys.stdin.read()
50
- try:
51
- with open(content_file, encoding="utf-8") as fh:
52
- return fh.read()
53
- except OSError as exc:
54
- output_error(4, "Cannot read content file", str(exc))
55
- return content
File without changes
File without changes
File without changes
File without changes
File without changes