Index of every page on this site: llms.txt
All skills
segmently-ai avatar

/segmently-cli-image-upload

@f3f9f19
Run it yourself

Upload images shared during Codex work to the Segmently CDN and return reusable URLs. Use when the user asks to save, upload, host, or get a URL for a screenshot/image from the chat, macOS clipboard, or a local image file. Also trigger when Segmently Launch Assistant returns executeWith.skill/owningSkill=segmently-cli-image-upload or asks for an image/video/media URL preparation step before a DO flow.

  • 3 files
  • 19.6 KB
  • Updated 5 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/segmently-ai/segmently-support-plugins/segmently-cli-image-upload

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈108 tokens for metadata: the name and description. ≈1.1k when used: this file. ≈89 more on demand in 1 file.

Description uses 5.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈433 characters, or 5.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Segmently CLI Image Upload

Use this skill when the user asks for a URL for an image during Codex work. Upload through the public Segmently CLI asset command. This skill must work from an installed skill/plugin copy and must not depend on the Segmently source repository, internal dev projects, or private service endpoints.

Default Destination

  • If the user gives a project id or the task is tied to a known Segmently project, use that project id.
  • If no project is known, ask explicitly for the Segmently projectId before uploading. Do not treat the account, email, funnel id, or screen id as a replacement for projectId. The helper also accepts SEGMENTLY_ASSET_PROJECT or SEGMENTLY_PROJECT.
  • If the image was pasted into chat, first clarify whether you can access the attachment/clipboard in the current agent environment. If not, ask for an absolute local file path or ask the user to copy the image again.
  • Store Codex-shared images under: projects/<projectId>/cli-assets/agent-upload/<timestamp>_<name>.
  • Always include the project/namespace and storage path in the answer, even when the user mainly asked for the original URL.

Workflow

  1. If the image was pasted into the chat, first try to save it from the macOS clipboard. This requires running osascript with escalation.
  2. If clipboard extraction fails or the clipboard is stale, ask for a local file path or ask the user to copy the image again.
  3. If projectId is still missing, stop and ask for it before running upload.
  4. Upload with:
    node scripts/upload-clipboard-image.mjs \
      --project <projectId>
  5. For an existing local image file:
    node scripts/upload-clipboard-image.mjs \
      --file /absolute/path/image.png \
      --project <projectId>
  6. Before upload, the helper checks the local image size. The default maximum is 10 MB, matching the Segmently image upload limit. For large raster images, downscale before upload on the client:
    node scripts/upload-clipboard-image.mjs \
      --file /absolute/path/image.png \
      --project <projectId> \
      --resize-max-edge 2400 \
      --resize-format webp \
      --resize-quality 85
    Resizing must preserve the original image proportions. The helper scales the image to fit inside the requested max edge; it must not crop, stretch, pad, or change aspect ratio. SVG and GIF files are not resized by the helper; reduce or replace them if they exceed --max-upload-bytes.
  7. Return this compact shape to the user:
    Project/namespace: <projectId>
    Path: projects/<projectId>/cli-assets/agent-upload/<name>
    Original URL: <origin>
    Small URL: <small>
    Asset: { "original": "<origin>", "small": "<small>" }

Auth And Capability Rules

  • Prefer segmently assets upload-image, which calls /api/cli/v1/projects/:projectId/assets/upload/image.
  • CLI upload requires assets:write and the target project Billing Access capability cli_assets.upload_image.
  • If the CLI reports auth_required, run segmently auth status and ask the user to authorize the target environment before retrying.
  • If the CLI reports a missing project capability, tell the user the project needs cli_assets.upload_image enabled; do not retry through an alternate private endpoint.
  • Segmently image upload rejects files over 10 MB. Run the helper with --resize-max-edge for client-side downscale when a screenshot or Figma export is too large. Segmently still produces its normal origin and small CDN variants after the preflight file is accepted.
  • Never print API keys, CLI tokens, or refresh tokens.

Useful Options

--project <id>       # defaults to SEGMENTLY_ASSET_PROJECT, then SEGMENTLY_PROJECT
--env <env>          # optional Segmently CLI environment override
--folder <folder>    # defaults to agent-upload under cli-assets
--name <name>        # defaults to clipboard
--file <path>        # upload a file instead of reading macOS clipboard
--max-upload-bytes <n>   # defaults to 10485760
--warn-upload-bytes <n>  # defaults to 5242880
--resize-max-edge <px>   # downscale raster images before upload
--resize-format <format> # keep, webp, jpeg, png; defaults to keep
--resize-quality <n>     # JPEG/WebP quality; defaults to 85
--asset              # print only { original, small }
--raw-url            # print only the original URL

Verification

node --check scripts/upload-clipboard-image.mjs
node scripts/upload-clipboard-image.mjs --help

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at f3f9f19. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 5 months ago

README badge

README badge for segmently-ai/segmently-support-plugins/segmently-cli-image-upload