Skip to content

Remove persona phone commands#11

Closed
giordano-lucas wants to merge 74 commits intosalmonumbrella:mainfrom
nottelabs:remove-persona-phone-commands
Closed

Remove persona phone commands#11
giordano-lucas wants to merge 74 commits intosalmonumbrella:mainfrom
nottelabs:remove-persona-phone-commands

Conversation

@giordano-lucas
Copy link
Contributor

No description provided.

giordano-lucas and others added 30 commits January 29, 2026 13:40
feat: add console-based CLI authentication
…flag

- Add --file-storage flag to sessions start command
- Export GetCurrentSessionID() and RequireSessionID() for reuse
- Update files commands to use shared sessionID variable and --id flag
- Remove required --session flag from files commands
- Files commands now use same session resolution as sessions commands
  (flag > env var > current session file)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GetClient() is called before RequireSessionID(), so the test needs
an API key to pass GetClient() and then fail on RequireSessionID().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: unify files command session ID resolution and add file-storage …
Add comprehensive integration tests for all API endpoints:
- sessions: lifecycle, cookies, observe, scrape, network
- agents: list, start, status, stop
- env: observe, execute, scrape flows
- personas: CRUD, emails, SMS
- profiles: CRUD with name options
- vaults: CRUD, credentials lifecycle with MFA
- storage: upload, download, list
- functions: CRUD, schedule, fork, runs

Add GitHub workflow (.github/workflows/integration-tests.yml):
- Runs on push/PR to main + manual trigger
- Uses NOTTE_API_KEY secret with staging API
- 30-minute timeout for full test suite

Update Makefile with new commands:
- make setup: install dev dependencies (golangci-lint, goimports, gofumpt)
- make test-integration: run integration tests
- make test-coverage: run tests with HTML coverage report
- make lint-fix: run linters with auto-fix
- make help: show all available commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The workflow now shows a warning and exits successfully if
NOTTE_API_KEY secret is not configured, instead of failing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add FlexibleTime type to handle API timestamps without timezone info
- Update generate.sh to replace time.Time with FlexibleTime in struct fields
- Fix action JSON format in tests, docs, and examples (use "type" not "action")
- Rename env_test.go to page_test.go and TestEnv* to TestPage*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove functions and function_runs tests (API not stable)
- Remove agents tests that don't work without session
- Fix storage tests to use --id flag instead of --session
- Keep only stable, working tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sessions need --file-storage flag to access the downloads endpoint.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: add integration tests and GitHub workflow
…ponse body'

The generated oapi-codegen client reads the response body into resp.Body ([]byte),
but ParseAPIError was trying to read from resp.HTTPResponse.Body which was already
consumed. This caused all API errors to show "failed to read response body".

Changes:
- Update ParseAPIError to accept body bytes as parameter instead of reading from response
- Update HandleAPIResponse to pass the already-read body bytes
- Update all command files to pass resp.Body to HandleAPIResponse
- Support both nested {"error": {"message": "..."}} and flat {"message": "..."} API error formats
- Add integration tests for error parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix: display actual API error messages instead of 'failed to read res…
Add syntactic sugar for page actions with a new `notte page <action>` command
structure. Instead of verbose JSON, users can now write:

  notte page click "#btn"
  notte page click @b3        # @-prefixed = element ID
  notte page fill @input "hello"
  notte page goto "https://example.com"

Commands added (21 total):
- Element actions: click, fill, check, select, download, upload
- Navigation: goto, new-tab, back, forward, reload
- Scrolling: scroll-down, scroll-up
- Keyboard: press
- Tab management: switch-tab, close-tab
- Utility: wait, scrape, captcha-solve, complete, form-fill

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive integration tests covering:
- Navigation: goto, new-tab, back, forward, reload
- Scrolling: scroll-down, scroll-up
- Keyboard: press, wait
- Tab management: switch-tab, close-tab
- Form interactions: fill, check, select, form-fill
- Data extraction: scrape with --main-only flag
- Workflow tests combining multiple commands
- Error handling tests
- Current session usage without --id flag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The API expects 'type' field instead of 'action' for specifying the
action type. Also fix TestPageFormFill to use valid field names from
the API schema (first_name, last_name, email, phone instead of
arbitrary field names).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove unused pageSessionID variable and use the global sessionID
directly so the --id flag works correctly with RequireSessionID().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Return error for empty selectors or bare '@' to prevent sending
invalid requests to the API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update to match new HandleAPIResponse signature that requires body bytes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: add notte page commands for simplified page actions
Add comprehensive documentation and templates for AI agents using the notte CLI:

- SKILL.md: Main skill documentation with command reference
- references/session-management.md: Browser session lifecycle guide
- references/function-management.md: Workflow functions guide
- references/account-management.md: Personas and vaults guide
- templates/form-automation.sh: Form filling template
- templates/authenticated-session.sh: Login with vault credentials
- templates/data-extraction.sh: Web scraping template
- .github/workflows/test-skills.yml: CI for shell script validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add guidance for using notte CLI with AI coding assistants:
- Simple prompt-based approach
- MCP skill installation for Claude Code, Cursor, Windsurf
- AGENTS.md/CLAUDE.md instructions template
- Link to skills documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix shellcheck SC2034 warning about unused variable by using
MFA_SELECTOR in the handle_mfa function log messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add NOTTE_FUNCTION_ID env var and current_function file support to
functions commands, mirroring the existing session ID pattern.

Resolution priority: --id flag > NOTTE_FUNCTION_ID env > current_function file

Changes:
- Add CurrentFunctionFile and EnvFunctionID constants to config
- Add GetCurrentFunctionID, RequireFunctionID, setCurrentFunction,
  clearCurrentFunction functions
- Update all function commands to use RequireFunctionID
- Create command saves function ID to current_function file
- Delete command clears current_function if matching
- Add comprehensive unit tests for function ID resolution
- Add integration tests for functions including ID resolution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `notte sessions code` command that calls the /{session_id}/workflow/code
endpoint and outputs only the python_script field from the response.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add notte.Session() to function content (required by API validation)
- Handle both array and paginated response formats in TestFunctionsList

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update installation references from salmonumbrella to nottelabs
- Fix command consistency (session → sessions, agent → agents, etc.)
- Add Formula/notte.rb for Homebrew tap
- Add brews section to goreleaser for auto-updating formula on release

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
giordano-lucas and others added 29 commits January 30, 2026 09:20
Move the default configuration directory to ~/.notte/cli/ for a cleaner
home directory structure that allows other notte tools to share the
~/.notte/ parent directory.
refactor: change config path from ~/.config/notte to ~/.notte/cli
* Hide sessions observe/execute/scrape in favor of page commands

- Set Hidden: true on sessionsObserveCmd, sessionsExecuteCmd, sessionsScrapeCmd
- Update README.md to document page commands as the primary interface
- Update skills documentation (SKILL.md, session-management.md)
- Update shell templates to use notte page commands

The hidden commands still work for backward compatibility but are no longer
shown in --help output, encouraging users to use the cleaner page interface.

* hide other cmd as well

* fix some formatting issues

* Refactor page commands to be true proxies for sessions commands

Eliminates code duplication by making page observe/scrape directly call their sessions counterparts. Unifies command-line interface to use consistent flag names across both command groups.

Key changes:
- Remove duplicate runPageObserve and runPageScrape functions (~70 lines)
- Unify flag variables: use sessionObserveURL and sessionScrapeOnlyMain
- Standardize interface: page scrape now uses --instructions flag instead of positional arg
- Update runSessionObserve to print only description in text mode for consistency
- Add 4 comprehensive unit tests for scrape argument combinations
- Update all documentation and templates to use unified interface

* Fix duplicate step numbering in README workflow

* address reviewer feedback

* address reviewer feedback
* fix: keyring auth

* fix: greptile

* fix: lint

* fix: linting
* Document session context and function development workflow

Part 1: Session Context-Driven Documentation
- Rework README.md and SKILL.md to emphasize automatic session tracking
- Remove --id flags from default examples to show typical usage
- Add notes explaining sessions are auto-tracked, --id is for advanced use

Part 2: Function Development Workflow
- Add comprehensive "Development Workflow" section to function-management.md
- Document iterative process: build → export → create → test → iterate → schedule
- Include complete end-to-end example with bash commands
- Enhance "Function File Format" section with detailed variable and return value docs
- Add examples showing type hints, parameters, and how to access results

* Apply context-driven approach to functions documentation

- Remove --id flags from default function command examples
- Show that functions auto-track like sessions (current function concept)
- Update run-metadata to show --run-id (required) without --id
- Add explanatory notes about automatic function tracking
- Updated both README.md and SKILL.md for consistency

* add other doc

* Apply context-driven approach to function-management.md (reapply)

All function commands now use current function approach:
- Removed --id flags from default examples throughout
- Added explanatory note about automatic function tracking
- Updated all code examples and workflows to be context-driven
- Consistent with README.md and SKILL.md
* error log

* fix: asserts
* feat: add screenshot

* add pre commit

* fix: lint
* fix: generate client from staging spec with endpoint exclusions

- Update generate.sh to use NOTTE_API_URL env var, defaulting to
  https://us-staging.notte.cc to get latest API features including viewer_url
- Exclude global scrape endpoints (/scrape, /scrape_from_html) from generation
- Exclude vault credit card endpoints (/vaults/{vault_id}/card) from generation
- Remove global scrape CLI commands (scrape, scrape-html)
- Remove vault credit card CLI commands (card, card-set, card-delete)
- Hide sessions debug command from help (still functional)
- Update documentation to remove references to excluded features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: remove usage logs command, move usage to utilities

- Remove `notte usage logs` subcommand
- Move `notte usage` documentation to Utilities section in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: use cross-platform sed syntax in generate.sh

Use sed -i.bak instead of sed -i '' for Linux compatibility,
then clean up backup files afterward.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* ci: verify generated code is up to date with staging OpenAPI spec

Add CI step that regenerates the API client from us-staging.notte.cc
and fails if there are any differences, ensuring committed code stays
in sync with the latest OpenAPI spec.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: error messages

* nicer outputs
* fix: use stored viewer URL instead of debug endpoint

- Store viewer_url from session start response in local state file
- Read stored viewer URL directly in viewer command (no API call needed)
- Fall back to session status API if stored URL not available
- Clear viewer URL file when session is stopped
- Remove unused constructViewerURL function and debug endpoint call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: make clearCurrentViewerURL error handling consistent

Match clearCurrentSession pattern by returning errors instead of
silently ignoring them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: auto-generate CLI flags from OpenAPI spec

Add a Go-based flag generator tool that parses the OpenAPI spec and
automatically generates Cobra flag definitions for CLI commands.

Key features:
- Simple scalar types (string, int, bool) become direct flags
- Enum types become string flags with values listed in description
- Nested objects are flattened (e.g., profile.id -> --profile-id)
- Primitive arrays become repeatable flags (e.g., --chrome-arg)
- Union types (string | enum) are handled via From*1 methods
- JSON file input for complex types (--response-format-json @file.json)
- Configurable skip list (notifier_config omitted)
- Build fails on unsupported field types to prompt manual handling

Generated files:
- scripts/gen-flags/{main,types,parser,codegen}.go - Generator tool
- internal/cmd/*_flags.gen.go - Generated flag definitions

The generator is integrated into generate.sh and runs automatically
after oapi-codegen. Commands still need to be updated to use the
generated Register*Flags() and Build*Request() functions.

* feat: integrate generated flags into command files

- Update sessions.go to use RegisterSessionStartFlags() and
  BuildSessionStartRequest(), keeping manual proxies handling
- Update agents.go to use RegisterAgentStartFlags() and
  BuildAgentStartRequest()
- Update personas.go, profiles.go, vaults.go to use generated flags
- Fix generated flag files for correct API type compatibility:
  - Use direct enum casts instead of union methods for simple enums
  - Fix SessionId/Task as required string fields (not pointers)
  - Fix Profile as pointer type
  - Fix ChromeArgs as *[]string
- Update output_helpers.go to handle new StructuredDataBaseModel type
- Update all test files to use new generated variable names

New flags now available:
- sessions start: --profile-id, --profile-persist, --chrome-args,
  --screenshot-type
- agents start: --url, --use-vision, --response-format-json,
  --session-offset (plus renamed --vault-id, --persona-id, --session-id)

* feat: add FlattenWithoutPrefix for clean credential flags

- Add FlattenWithoutPrefix map in types.go for command-scoped fields
  that should flatten without parent prefix
- VaultCredentialsAdd.credentials now generates --email, --password,
  --url, --username, --mfa-secret (not --credentials-*)
- Update isFlattenableObject to support force-flattening via config
- Fix struct type name conversion (handle hyphenated schema names)
- Fix required field assignment (use value not pointer)
- Update vaults.go to use generated credentials flags
- Update vaults_test.go for new variable names

* style: fix linting issues in gen-flags

- Apply gofumpt formatting
- Replace WriteString(fmt.Sprintf(...)) with fmt.Fprintf(...)
- Use switch statements instead of if-else chains

* fix: update integration tests for new flag names

Update flag names to match auto-generated flags:
- --session → --session-id
- --browser → --browser-type
- --idle-timeout → --idle-timeout-minutes
- --max-duration → --max-duration-minutes
- --file-storage → --use-file-storage

* fix: correct generator for enum types, pointers, and slices

- Add IsUnionType flag to Field struct to properly distinguish
  union types (anyOf enum+string) from simple enums
- Simple enums now generate correct type names without underscore
  (e.g., ApiSessionStartRequestBrowserType)
- Union types still use underscore naming convention
- Only include fmt/json/os/strings imports when actually needed
- Flattened optional structs now correctly use pointer assignment
- Repeated fields (slices) now pass directly instead of converting
  to []interface{}

* docs: update flag names in README and skills

Update documentation to reflect new auto-generated flag names:
- --browser → --browser-type
- --idle-timeout → --idle-timeout-minutes
- --max-duration → --max-duration-minutes
- --file-storage → --use-file-storage

Updated files:
- README.md
- skills/notte-browser/SKILL.md
- skills/notte-browser/references/session-management.md

* fix: validate required string fields are not empty

Required string fields now check that the value is not empty when
the flag is explicitly set (e.g., --url ""). This prevents sending
empty strings for required API fields.

* fix: validate flattened objects have required fields

When optional fields of a flattened object are provided without the
required fields, the generator now emits an error instead of silently
not creating the struct.

Example: `--profile-persist` without `--profile-id` now errors:
  "profile requires --profile-id to be set"

* fix: remove unused variable in codegen

* fix: only set optional flattened fields when non-empty

API rejects empty strings for mutually exclusive fields like
email/username. Now optional string fields in flattened objects
are only included when they have a value.
* fix: standardize notte-browser skill templates and references

- Update selectors from bare IDs (B3, I1, L5) to @-prefixed format (@b3, @i1, @l5)
- Add version 1.0.0 and frontmatter to SKILL.md
- Fix command name: notte sessions code → notte sessions workflow-code
- Change observe --url to separate goto + observe commands in templates
- Uncomment screenshot functionality in form-automation.sh
- Add frontmatter with name/description to all reference files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: update README with new commands and formatting

- Remove emoji from title
- Add new session commands: viewer, code
- Add new session start options: profile-id, profile-persist, screenshot-type, chrome-args
- Expand page actions with scroll-up, screenshot, select, check, upload, download, tabs, reload, wait, captcha-solve
- Add Profiles section for browser profile management
- Add --yes flag to global options
- Fix various formatting and capitalization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* generate sdk

* feat: add page eval-js command and fix FileInfo type change

- Add `notte page eval-js <code>` command to execute JavaScript on pages
- Update files.go to handle new []FileInfo response type (was []string)
- Update files_test.go mocks to use FileInfo objects
* feat: add NOTTE_AGENT_ID management for improved DX

- Auto-save agent ID after `notte agents start` to ~/.notte/cli/current_agent
- Auto-use current session ID in `notte agents start` if not specified
- Make --id flag optional for agent commands (status, stop, workflow-code, replay)
- Agent ID resolution priority: flag > NOTTE_AGENT_ID env var > file
- Clear current agent file when stopping the matching agent
- Add comprehensive tests for agent ID management
- Update documentation in README.md and SKILL.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: make RequireAgentID side effect explicit

Only assign to global agentID after validating the resolved ID is non-empty.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: extract clearCurrentAgentIfMatches helper

Encapsulate read-check-delete logic to reduce race condition window
between reading and clearing the agent file.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: log warning when clearing current agent fails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add skill command to install/remove notte skill via npx

Adds `notte skill add` and `notte skill remove` commands that proxy to
`npx skills add/remove nottelabs/notte-cli` for installing the Notte
browser automation skill in AI coding assistants.

Includes prerequisite checks for npx and the skills package with
helpful error messages if dependencies are missing.

* refactor: simplify prerequisite check to only verify npx

Remove the skills package check since npx auto-downloads packages,
making the check ineffective.

* refactor: remove npx prerequisite check
)

* fix: functions run command with API key header and variable support

Fixed two critical issues with the 'functions run' command:

1. Missing x-notte-api-key header - The FunctionRunStartParams required
   field was not being populated, causing 400 errors
2. Missing request body - API requires function_id in JSON body but
   generated client doesn't support it

Added variable support for workflow execution:
- --var flag for key=value pairs (can be used multiple times)
- --vars flag for JSON object string
- Variables are passed to the function run API

Changes:
- Added APIKey() method to NotteClient
- Rewrote runFunctionRun to manually construct HTTP request with body
- Added integration tests for function run and variables
- Added unit test for APIKey() method

Resolves issue with function run failing with API key validation error

* chore: add make pre-commit-run and pre-push-run commands

* fix: update linting setup and formatting

- Upgrade to golangci-lint v2 to match CI configuration
- Fix errcheck issue: properly handle httpResp.Body.Close() error
- Fix gofumpt formatting issues in functions.go
- Update make lint to suppress cache warnings
- Update make pre-commit-run to run full lint on all code
- Fix staticcheck SA5011 in client_test.go by removing redundant nil check
#42)

* feat: add request headers for tracking (x-notte-request-origin, x-notte-sdk-version)

Add two headers to all API requests:
- x-notte-request-origin: "cli"
- x-notte-sdk-version: CLI version string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add test coverage for tracking headers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Remove the personas phone-create and phone-delete CLI commands and
exclude the /personas/{id}/sms/number endpoint from SDK generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants