[NOT-650] Add profile duplication command - #53
Draft
leo-notte wants to merge 2 commits into
Draft
Conversation
|
| Filename | Overview |
|---|---|
| internal/cmd/profiles.go | Adds and registers the profile duplication command, builds its authenticated POST request, handles API errors, and prints the duplicated profile. |
| internal/cmd/profiles_test.go | Adds focused coverage for the duplicate command's HTTP method, endpoint, optional name payload, and rendered profile output. |
Reviews (3): Last reviewed commit: "feat: add profile duplication command" | Re-trigger Greptile
giordano-lucas
added a commit
that referenced
this pull request
Aug 31, 2026
The manifest #85 introduced listed five endpoints as "not exposed yet". Four of them are worth having, so they are commands now and the skip lines are gone - which is the file working as intended, as a list of decisions to revisit rather than a place gaps go to be forgotten. `profiles duplicate` stays listed: it is already proposed in #53. notte personas update --persona-id <id> --name ... notte profiles cookies --profile-id <id> notte profiles cookies-set --profile-id <id> --file cookies.json notte usage logs [--endpoint ...] [--page N] [--page-size N] `personas update` is generated: PATCH /personas/{persona_id} is a JSON body behind a $ref, so it needed an endpointMap entry and nothing else. `profiles cookies-set` accepts either shape a cookies file comes in - a bare array, which is what Playwright's storageState and the browser extensions write, or an object with a `cookies` key. Making the caller reshape their own export first would be a papercut for no reason. --source-format and --mode are sent only when passed. `usage logs` exposes --endpoint, --only-current-token and --include-system alongside the shared pagination flags. only_active is deliberately left out: it is the generic listing filter and a request log is never active or inactive. Two corrections come with them. --instructions on `functions configure` is renamed --run-instructions, and its help and both repositories' docs are rewritten. The field documents a function for whoever calls it - how long a run takes, what each variable means, which sites it trips over - and I had described it as configuration for the self-healing agent, which is what the bare name reads like and is not what it is. The API field is untouched; only the flag is renamed, through a new command-scoped override in the generator so the name stays declared in one place. Free to rename: v0.0.37 predates #84, so the flag has never shipped. The skill checker now also requires documentation for a command that both runs and has subcommands. `notte usage` is one as of this change, and the old leaf-only rule would have let it slip out of the check the moment it grew `usage logs`. Verified against us-staging: `personas update` renames and reads back; the other three are covered by mock-server tests asserting the request. `usage logs` could not be verified live - /usage/logs returns 503 after ~25s to plain curl on staging, before any of this code is involved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
giordano-lucas
added a commit
that referenced
this pull request
Aug 31, 2026
The manifest #85 introduced listed five endpoints as "not exposed yet". Four of them are worth having, so they are commands now and the skip lines are gone - which is the file working as intended, as a list of decisions to revisit rather than a place gaps go to be forgotten. `profiles duplicate` stays listed: it is already proposed in #53. notte personas update --persona-id <id> --name ... notte profiles cookies --profile-id <id> notte profiles cookies-set --profile-id <id> --file cookies.json notte usage logs [--endpoint ...] [--page N] [--page-size N] `personas update` is generated: PATCH /personas/{persona_id} is a JSON body behind a $ref, so it needed an endpointMap entry and nothing else. `profiles cookies-set` accepts either shape a cookies file comes in - a bare array, which is what Playwright's storageState and the browser extensions write, or an object with a `cookies` key. Making the caller reshape their own export first would be a papercut for no reason. --source-format and --mode are sent only when passed. `usage logs` exposes --endpoint, --only-current-token and --include-system alongside the shared pagination flags. only_active is deliberately left out: it is the generic listing filter and a request log is never active or inactive. Two corrections come with them. --instructions on `functions configure` is renamed --run-instructions, and its help and both repositories' docs are rewritten. The field documents a function for whoever calls it - how long a run takes, what each variable means, which sites it trips over - and I had described it as configuration for the self-healing agent, which is what the bare name reads like and is not what it is. The API field is untouched; only the flag is renamed, through a new command-scoped override in the generator so the name stays declared in one place. Free to rename: v0.0.37 predates #84, so the flag has never shipped. The skill checker now also requires documentation for a command that both runs and has subcommands. `notte usage` is one as of this change, and the old leaf-only rule would have let it slip out of the check the moment it grew `usage logs`. Verified against us-staging: `personas update` renames and reads back; the other three are covered by mock-server tests asserting the request. `usage logs` could not be verified live - /usage/logs returns 503 after ~25s to plain curl on staging, before any of this code is involved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
giordano-lucas
added a commit
that referenced
this pull request
Aug 31, 2026
* feat: close four of the gaps the coverage manifest recorded The manifest #85 introduced listed five endpoints as "not exposed yet". Four of them are worth having, so they are commands now and the skip lines are gone - which is the file working as intended, as a list of decisions to revisit rather than a place gaps go to be forgotten. `profiles duplicate` stays listed: it is already proposed in #53. notte personas update --persona-id <id> --name ... notte profiles cookies --profile-id <id> notte profiles cookies-set --profile-id <id> --file cookies.json notte usage logs [--endpoint ...] [--page N] [--page-size N] `personas update` is generated: PATCH /personas/{persona_id} is a JSON body behind a $ref, so it needed an endpointMap entry and nothing else. `profiles cookies-set` accepts either shape a cookies file comes in - a bare array, which is what Playwright's storageState and the browser extensions write, or an object with a `cookies` key. Making the caller reshape their own export first would be a papercut for no reason. --source-format and --mode are sent only when passed. `usage logs` exposes --endpoint, --only-current-token and --include-system alongside the shared pagination flags. only_active is deliberately left out: it is the generic listing filter and a request log is never active or inactive. Two corrections come with them. --instructions on `functions configure` is renamed --run-instructions, and its help and both repositories' docs are rewritten. The field documents a function for whoever calls it - how long a run takes, what each variable means, which sites it trips over - and I had described it as configuration for the self-healing agent, which is what the bare name reads like and is not what it is. The API field is untouched; only the flag is renamed, through a new command-scoped override in the generator so the name stays declared in one place. Free to rename: v0.0.37 predates #84, so the flag has never shipped. The skill checker now also requires documentation for a command that both runs and has subcommands. `notte usage` is one as of this change, and the old leaf-only rule would have let it slip out of the check the moment it grew `usage logs`. Verified against us-staging: `personas update` renames and reads back; the other three are covered by mock-server tests asserting the request. `usage logs` could not be verified live - /usage/logs returns 503 after ~25s to plain curl on staging, before any of this code is involved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: refuse an empty cookie set instead of emptying the profile Greptile catch. `[]` parses fine as an array, so the bare-array branch sent an empty cookie list - and --mode defaults to replace, so the API would have emptied the profile. The wrapped-object branch already refused this; now both do, through one error so they cannot drift apart again. The test covers every shape that means "no cookies": a bare `[]`, a wrapped empty list, an object with no cookies key, and whitespace. Each asserts nothing reached the API, not just that an error came back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
notte profiles duplicate --profile-id <id>--nameCompanion to nottelabs/monorepo#1918.
Linear: NOT-650 https://linear.app/nottelabsinc/issue/NOT-650/notte-cli-pr-53-add-profile-duplication-command