Skip to content

Conversation

@giordano-lucas
Copy link
Member

@giordano-lucas giordano-lucas commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR refactors the CLI to deprecate session commands (observe, execute, scrape) by hiding them and promoting page commands as the primary interface for browser interactions.

Key Changes

  • Hidden notte sessions observe/execute/scrape commands (set Hidden: true) with comments directing users to use notte page commands instead
  • Refactored notte page observe and notte page scrape to proxy directly to runSessionObserve and runSessionScrape functions
  • Updated flag names for consistency: --main-only--only-main-content
  • Removed duplicate test implementations in page_test.go that are now covered by sessions_test.go
  • Added comprehensive test coverage for scrape command with various flag combinations
  • Updated all documentation and templates across the repository to use page commands
  • Hidden notte functions run-metadata-update command

Issues Found

  • README.md: Two instances showing incorrect notte page scrape syntax using positional arguments instead of --instructions flag (lines 133, 404)

Confidence Score: 4/5

  • This PR is safe to merge after fixing the documentation syntax errors
  • The refactoring is well-executed with proper code organization, comprehensive test coverage, and consistent updates across documentation. The core logic correctly proxies page commands to session commands. However, the README documentation has syntax errors showing incorrect command usage that would confuse users
  • README.md needs corrections to scrape command syntax (lines 133, 404)

Important Files Changed

Filename Overview
README.md Updated documentation to use page commands instead of session commands, but has incorrect scrape command syntax
internal/cmd/page.go Refactored page commands to proxy to session commands, properly using shared implementation
internal/cmd/sessions.go Hidden deprecated commands (observe, execute, scrape) with appropriate comments directing users to page commands
tests/integration/page_commands_test.go Updated integration tests to use --instructions flag and --only-main-content flag correctly

- 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.
@giordano-lucas giordano-lucas self-assigned this Jan 30, 2026
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@giordano-lucas giordano-lucas force-pushed the hide-session-page-commands branch from e50cc05 to bcf71fb Compare January 30, 2026 09:51
@giordano-lucas
Copy link
Member Author

@greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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
@giordano-lucas
Copy link
Member Author

@greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@giordano-lucas
Copy link
Member Author

@greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

README.md Outdated

```bash
notte page observe # Get page state and available actions
notte page scrape [instructions] # Scrape content from the page
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scrape command no longer accepts positional arguments - instructions must be passed via the --instructions flag

Suggested change
notte page scrape [instructions] # Scrape content from the page
notte page scrape --instructions "..." # Scrape content from the page
Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 133:133

Comment:
The `scrape` command no longer accepts positional arguments - instructions must be passed via the `--instructions` flag

```suggestion
notte page scrape --instructions "..." # Scrape content from the page 
```

How can I resolve this? If you propose a fix, please make it concise.

README.md Outdated
2. `notte page goto <url>` - Navigate to a URL
3. `notte page observe` - Get interactive elements with IDs (@B1, @B2)
4. `notte page click @B1` / `notte page fill @B2 "text"` - Interact using element IDs
5. `notte page scrape "..."` - Extract structured data
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scrape command no longer accepts positional arguments - instructions must be passed via the --instructions flag

Suggested change
5. `notte page scrape "..."` - Extract structured data
5. `notte page scrape --instructions "..."` - Extract structured data
Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 404:404

Comment:
The `scrape` command no longer accepts positional arguments - instructions must be passed via the `--instructions` flag

```suggestion
5. `notte page scrape --instructions "..."` - Extract structured data
```

How can I resolve this? If you propose a fix, please make it concise.

@giordano-lucas giordano-lucas merged commit ae99dac into main Jan 30, 2026
3 checks passed
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.

2 participants