toss-portfolio-state

Installation
SKILL.md

Toss Portfolio State

Collect a read-only Toss Invest OpenAPI snapshot as a normalized toss_portfolio_snapshot for temporary account-state evidence.

Quick Start

  1. Read references/snapshot-contract.md before mapping fields or changing the script.

  2. Confirm from the requested outcome that the task is read-only. If it includes orders, transfers, automatic rebalancing, or live execution, state the boundary and stop before loading credentials.

  3. Check prerequisites. Both scripts need Bun on this device (verified with 1.4.2). The direct route needs Toss Invest OpenAPI credentials (TOSS_INVEST_API_KEY and TOSS_INVEST_SECRET_KEY) in an env file the user names or in the process environment. The remote route needs ssh on this device and the credentials on the remote host at the fixed paths in references/remote-access.md. If Bun is missing, return a blocker that points to the official Bun install instructions; installing it needs the user's approval. Never store secrets, tokens, raw account numbers, or raw broker responses in the skill directory.

  4. Choose the route and run the transport bundled with the active skill directory:

    • If ~/.config/toss-portfolio-state/remote.json exists (or the file named by TOSS_PORTFOLIO_REMOTE_CONFIG), a remote route is configured: a host the user controls, such as a home server, whose public IP Toss accepts. Read references/remote-access.md and run:

      bun --no-env-file --no-install scripts/remote_portfolio_snapshot.ts fetch --market-context basic --orders-days 30 --recent-orders-limit 40
      
    • If no remote route is configured and the user's Toss API key accepts requests only from a registered IP that this device does not have, offer the one-time remote setup in references/remote-access.md. Run it only after the user approves the local SSH key and config changes.

    • Otherwise, run the direct fetcher with an explicit env file that the user names. Load credentials only from that file or the process environment, and keep --no-env-file so Bun does not auto-load an ambient .env:

Installs
32
GitHub Stars
2
First Seen
Jul 10, 2026