{"id":49319313,"url":"https://github.com/major/marketsurge-agent","last_synced_at":"2026-05-04T23:03:10.933Z","repository":{"id":352938055,"uuid":"1217287625","full_name":"major/marketsurge-agent","owner":"major","description":"CLI tool that gives AI agents structured access to MarketSurge stock research data","archived":false,"fork":false,"pushed_at":"2026-04-21T20:41:25.000Z","size":130,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T20:42:34.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/major.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-21T18:28:19.000Z","updated_at":"2026-04-21T20:39:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/major/marketsurge-agent","commit_stats":null,"previous_names":["major/marketsurge-agent"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/major/marketsurge-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmarketsurge-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmarketsurge-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmarketsurge-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmarketsurge-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/major","download_url":"https://codeload.github.com/major/marketsurge-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmarketsurge-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-26T17:00:40.611Z","updated_at":"2026-04-26T17:00:41.227Z","avatar_url":"https://github.com/major.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marketsurge-agent\n\nCLI tool that gives AI agents structured access to [MarketSurge](https://marketsurge.investors.com) stock research data. Every command returns JSON, making it easy to integrate with agent frameworks, pipelines, or scripts.\n\n\u003e **Disclaimer**: This project is unofficial and is not affiliated with, approved by, or endorsed by MarketSurge or Investor's Business Daily. Use at your own risk.\n\n## Install\n\nPre-built binaries are available on the [Releases](https://github.com/major/marketsurge-agent/releases) page for Linux and macOS (amd64/arm64).\n\nFrom source:\n\n```bash\ngo install github.com/major/marketsurge-agent/cmd/marketsurge-agent@latest\n```\n\n## Authentication\n\nMarketSurge requires a valid JWT. The CLI resolves credentials in this order:\n\n1. `--jwt` flag\n2. `MARKETSURGE_TOKEN` environment variable\n3. `--cookie-db` path to a Firefox `cookies.sqlite` file\n4. Auto-discovery from local Firefox profiles\n\nThe simplest approach for automation:\n\n```bash\nexport MARKETSURGE_TOKEN=\"your-jwt-here\"\n```\n\n## Usage\n\n```bash\n# Get stock data for a single symbol\nmarketsurge-agent stock get AAPL\n\n# Analyze multiple symbols concurrently\nmarketsurge-agent stock analyze AAPL MSFT NVDA GOOG\n\n# Analyze a comma-separated batch and remove formatted duplicate fields\nmarketsurge-agent stock analyze --tickers AAPL,MSFT,NVDA --compact\n\n# Flatten each analysis result for lower-token agent parsing\nmarketsurge-agent stock analyze AAPL --flat\n\n# Fundamental data\nmarketsurge-agent fundamental get TSLA\n\n# Institutional ownership\nmarketsurge-agent ownership get AMZN\n\n# Relative strength history\nmarketsurge-agent rs-history get META\n\n# Chart price history (daily, last 90 days)\nmarketsurge-agent chart history AAPL --period 90\n\n# Chart markups and annotations\nmarketsurge-agent chart markups AAPL\n\n# List available watchlists, screens, and reports\nmarketsurge-agent catalog list\n\n# Run a specific watchlist\nmarketsurge-agent catalog run --kind watchlist --watchlist-id 12345\n\n# Run a report with filters\nmarketsurge-agent catalog run --kind report --report-id 67890 --min-composite 90 --min-rs 80\n```\n\nAll commands return a JSON envelope:\n\n```json\n{\n  \"data\": { ... },\n  \"metadata\": { \"symbol\": \"AAPL\" },\n  \"timestamp\": \"2026-04-21T12:00:00Z\"\n}\n```\n\nErrors follow the same pattern:\n\n```json\n{\n  \"error\": \"symbol not found\",\n  \"code\": 2,\n  \"message\": \"XYZZY: no matching symbol\",\n  \"timestamp\": \"2026-04-21T12:00:00Z\"\n}\n```\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `stock get \u003csymbol\u003e` | Stock data (ratings, pricing, financials) |\n| `stock analyze [symbols...]` | Concurrent single-symbol or multi-symbol analysis with optional compact, flat, and comma-separated batch modes |\n| `fundamental get \u003csymbol\u003e` | Fundamental analysis data |\n| `ownership get \u003csymbol\u003e` | Institutional ownership |\n| `rs-history get \u003csymbol\u003e` | Relative strength rating history |\n| `chart history \u003csymbol\u003e` | Price history (daily or weekly) |\n| `chart markups \u003csymbol\u003e` | Chart annotations and markups |\n| `catalog list` | List watchlists, screens, reports |\n| `catalog run` | Run a watchlist, screen, or report |\n| `skills generate` | Generate agent skill documentation |\n\n## Agent integration\n\n### Token-efficient stock analysis\n\n`stock analyze` supports output modes designed for AI agents and batch comparison workflows:\n\n```bash\nmarketsurge-agent stock analyze --tickers AAPL,MSFT,NVDA --compact --flat\n```\n\n- `--tickers AAPL,MSFT,NVDA` analyzes comma-separated symbols in one command. Positional symbols still work and can be combined with `--tickers`.\n- `--compact` removes duplicate formatted string fields such as `market_cap_formatted`, while keeping raw numeric values.\n- `--flat` flattens each analysis result inside the standard JSON envelope, for example `stock.pricing.market_cap` becomes `pricing_market_cap`.\n\n`stock analyze` also includes MarketSurge technical context for chart-driven screening: `stock.base_pattern` summarizes the current base with pattern type, base stage, pivot price, base length, depth, and volume at pivot; `stock.signals` reports blue dot and ant signal flags when the API provides them.\n\nThe `skills generate` command writes Markdown skill files to `skills/` that describe each command's inputs, outputs, and usage. These files are designed for consumption by AI agent frameworks that support tool/skill discovery.\n\n```bash\nmarketsurge-agent skills generate\n```\n\n## Development\n\nRequires Go 1.26+.\n\n```bash\nmake build     # Build binary\nmake test      # Run tests with race detector\nmake lint      # Run golangci-lint (install: https://golangci-lint.run/welcome/install/)\nmake clean     # Remove binary and build artifacts\n```\n\n### Project layout\n\n```text\ncmd/marketsurge-agent/   Entry point\ninternal/\n  auth/                  JWT resolution (4-tier chain)\n  client/                GraphQL client + API methods\n  commands/              CLI command implementations\n  constants/             API endpoints, column names\n  cookies/               Firefox cookie extraction\n  errors/                Typed error hierarchy\n  models/                Data structures\n  output/                JSON envelope formatting\nqueries/                 Embedded GraphQL queries\nskills/                  Generated agent skill docs\n```\n\n### Running tests\n\n```bash\ngo test -v -race ./...\n```\n\nTests use `httptest.NewServer` for HTTP mocking with no external mock libraries.\n\n### Releasing\n\nPush a version tag to trigger a [GoReleaser](https://goreleaser.com) build:\n\n```bash\ngit tag v1.2.3\ngit push origin v1.2.3\n```\n\nThis produces binaries for linux/darwin on amd64/arm64, published to GitHub Releases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor%2Fmarketsurge-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajor%2Fmarketsurge-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor%2Fmarketsurge-agent/lists"}