Conversation
notehub/cmd/project.go
Outdated
| } | ||
|
|
||
| projectsRsp := ProjectsResponse{} | ||
| err := reqHubV1(GetVerbose(), GetAPIHub(), "GET", "/v1/projects", nil, &projectsRsp) |
There was a problem hiding this comment.
I think we should consider using the Notehub Golang SDK instead of essentially rewriting it by hand. It'll be a LOT less code and have better compile-time checks
There was a problem hiding this comment.
@scottfrazer I was planning on this but I believe it's private to the hub repo? I'm happy to change over to using it otherwise
There was a problem hiding this comment.
For example, instead of duplicating the Project and ProjectResponse objects and having to do the HTTP request, we could do:
projects, httpResp, err := sdk.ProjectAPI.
GetProjects(ctx).
Execute()This SDK is automatically generated from the OpenAPI spec
There was a problem hiding this comment.
Yes, it is private currently. We need to develop a process to publish it (like we for the JavaScript SDK). So far we haven't done it simply because there wasn't a specific need for it since we only use the SDK internally right now
But there's no reason why it shouldn't be public!
There was a problem hiding this comment.
Let me know when you have a mechanism to publish it, and I'll change over to use it! Looking forward to it!
…ling, and V1 migration - Add new commands: billing, event, monitor, note, notefile, usage, docs - Add set/clear subcommands for fleet, route, monitor, and product defaults - Add hybrid pagination (--limit/--all) to list commands - Migrate explore command from V0 to SDK (ListNotefiles/GetNotefile) - Improve network error handling with user-friendly messages - Remove unused V0 wrapper functions and clean up imports - Add auto-generated CLI docs via cobra/doc - Add notehub/doc/ to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cobra defaults cmd.Printf to stderr when no output writer is set. This prevented piping --json/--pretty output to tools like jq. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes strict JSON deserialization that rejected unknown fields from the API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rdize patterns - Add printActionResult helper for --json support on 18 action/mutation commands - Add validateAuth to replace GetCredentials (which called os.Exit, bypassing Cobra) - Add resolveProduct, resolveMonitor helpers for UID-or-name lookup - Add pickPaginated helper with colorless theme, used by all resource pickers - Add device picker to all single-device commands (get, delete, signal, health, etc.) - Add cursor-based --all pagination to event list - Extract deviceEnableDisable shared helper for enable/disable commands - Extract dfuAction shared helper for DFU update/cancel commands - Share scopeHelpLong constant and addScopeFlag helper across scope-using commands - Standardize error messages (consistent format for not-found, missing input, auth) - Standardize success messages (no "successfully!", no trailing punctuation) - Fix isNetworkError false positive on *os.PathError (satisfies net.Error interface) - Remove dead GetCredentials function from root.go Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ructive actions - Add device set/clear to persist a default device (used by get, health, session, events, plans, keys, signal, delete when no arg given) - Add confirmAction helper with --yes/-y flag to skip prompt - Add confirmation to all destructive commands: device delete, device disable, project delete, product delete, fleet delete, route delete, monitor delete, note delete, notefile delete - Fix route create/update to use printMutationResult for --json support - Fix setDefault display when label equals UID (no redundant parenthetical) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…V1 migration hints - Add bulk provisioning from CSV/JSON files (--file flag) with per-device serial numbers and fleet UIDs - Add vars delete command to remove env vars from devices, fleets, or project - Add device config command showing full env var hierarchy with inheritance - Add retry logic with exponential backoff (3 retries, 500ms/1s/2s) on all HTTP calls (SDK, V0 API, upload) for transient 5xx and network errors - Add V1 CLI migration hints: old flags like -signin, -explore, -req show the equivalent V2 command syntax Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Settings now display structured UID/label fields instead of just the raw UID, making it easier to identify the active project at a glance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix retryTransport to reset request body via GetBody before retries, and skip retry for non-replayable POST/PUT bodies - Deduplicate auth logic: initCommand now calls validateAuth internally - Extract pickerNext/pickerPrev constants for navigation sentinel values - Use scopeHelpLong in deviceMoveCmd (was the only scope command missing it) - Use pastTense variable instead of string concatenation in verbose output Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move version variable to main.go so GoReleaser's default ldflags (-X main.version) work automatically. Simplify --version output to just print the version string without the "notehub version" prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No description provided.