Skip to content

Conversation

@giordano-lucas
Copy link
Member

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

Greptile Overview

Greptile Summary

This PR transitions the CLI to generate its API client from the staging OpenAPI spec instead of production, and removes several deprecated commands based on excluded endpoints.

Key Changes

  • Client Generation: Updated scripts/generate.sh to fetch OpenAPI spec from staging environment (us-staging.notte.cc) by default, with production URL still available via NOTTE_API_URL env var
  • Cross-Platform Compatibility: Fixed sed commands to use cross-platform syntax (.bak extension) instead of macOS-only (-i '') syntax, with cleanup of backup files
  • CI Validation: Added CI check to verify generated code stays in sync with OpenAPI spec, preventing drift
  • Removed Commands: Deleted global scrape commands (scrape, scrape-html), usage logs command, and vault credit card commands (card operations) based on excluded endpoints
  • API Client Updates: Regenerated client.gen.go from staging spec, removing corresponding endpoint methods and adding new fields (PersistedDomains in ProfileResponse, ViewerUrl in SessionResponse, enhanced ScrapeAction options)
  • Documentation: Updated README and skill documentation to reflect removed commands and promote session-based scraping as the preferred approach

Migration Path

The PR effectively deprecates global scraping in favor of session-based scraping (notte sessions startnotte page scrapenotte sessions stop), which provides better control and observability.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and align with the PR's stated goals. The code generation script improvements enhance cross-platform compatibility, CI validation ensures generated code stays in sync, and the removal of deprecated commands is clean with proper test cleanup. All documentation has been updated accordingly.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/ci.yml Added validation check to ensure generated code stays in sync with OpenAPI spec
scripts/generate.sh Updated to use staging API by default, improved cross-platform sed compatibility, added backup cleanup
scripts/excluded-endpoints.txt Added global scrape and vault card endpoints to exclusion list
internal/api/client.gen.go Regenerated client from staging spec, removed global scrape and vault card endpoints, added new model and fields
internal/cmd/scrape.go Deleted entire file - removed global scrape commands in favor of session-based scraping
internal/cmd/usage.go Removed usage logs subcommand and related flags, kept only usage show command
internal/cmd/vaults.go Removed vault credit card commands (card, card-set, card-delete) and related flags

giordano-lucas and others added 2 commits January 30, 2026 16:55
- 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>
- Remove `notte usage logs` subcommand
- Move `notte usage` documentation to Utilities section in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Additional Comments (1)

scripts/generate.sh
sed -i '' is macOS-specific syntax and will fail on Linux. Use a cross-platform approach.

# Rename NewClient to newGeneratedClient to avoid collision with wrapper
# Only rename the base NewClient, not NewClientWithResponses
sed -i.bak 's/^func NewClient(/func newGeneratedClient(/g' "$OUTPUT_DIR/client.gen.go"
# Also update the call to NewClient within NewClientWithResponses
sed -i.bak 's/NewClient(server, opts\.\.\.)/newGeneratedClient(server, opts...)/g' "$OUTPUT_DIR/client.gen.go"

# Replace time.Time with FlexibleTime in struct fields for flexible timestamp parsing
# This handles API responses that don't include timezone info
sed -i.bak 's/\(	[A-Za-z]*\) time\.Time /\1 FlexibleTime /g' "$OUTPUT_DIR/client.gen.go"
sed -i.bak 's/\(	[A-Za-z]*\) \*time\.Time /\1 *FlexibleTime /g' "$OUTPUT_DIR/client.gen.go"

# Remove backup files
rm -f "$OUTPUT_DIR/client.gen.go.bak"
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/generate.sh
Line: 115:122

Comment:
`sed -i ''` is macOS-specific syntax and will fail on Linux. Use a cross-platform approach.

```suggestion
# Rename NewClient to newGeneratedClient to avoid collision with wrapper
# Only rename the base NewClient, not NewClientWithResponses
sed -i.bak 's/^func NewClient(/func newGeneratedClient(/g' "$OUTPUT_DIR/client.gen.go"
# Also update the call to NewClient within NewClientWithResponses
sed -i.bak 's/NewClient(server, opts\.\.\.)/newGeneratedClient(server, opts...)/g' "$OUTPUT_DIR/client.gen.go"

# Replace time.Time with FlexibleTime in struct fields for flexible timestamp parsing
# This handles API responses that don't include timezone info
sed -i.bak 's/\(	[A-Za-z]*\) time\.Time /\1 FlexibleTime /g' "$OUTPUT_DIR/client.gen.go"
sed -i.bak 's/\(	[A-Za-z]*\) \*time\.Time /\1 *FlexibleTime /g' "$OUTPUT_DIR/client.gen.go"

# Remove backup files
rm -f "$OUTPUT_DIR/client.gen.go.bak"
```

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

giordano-lucas and others added 2 commits January 30, 2026 17:10
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>
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>
@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.

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@giordano-lucas giordano-lucas merged commit a51d3f7 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