-
-
Notifications
You must be signed in to change notification settings - Fork 872
Add gui-new skill — shareable HTML canvases via API #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| name: gui-new | ||
| description: "Create shareable HTML canvases via the gui.new API. Use when: (1) generating visual output (dashboards, charts, forms, tables, diagrams, landing pages, interactive tools), (2) user asks to share or preview HTML as a live link, (3) user wants to turn code output into something viewable by others, (4) creating Mermaid diagrams as shareable links. POST HTML, get a live URL with real-time input sync and state persistence built in." | ||
| --- | ||
|
|
||
| # gui.new | ||
|
|
||
| HTML in, URL out. One API call turns HTML into a shareable link. | ||
|
|
||
| ## Create a Canvas | ||
|
|
||
| ```bash | ||
| curl -X POST https://gui.new/api/canvas \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"html": "<h1>Hello</h1>", "title": "My Canvas"}' | ||
| ``` | ||
|
|
||
| Response: `{"id": "abc123", "url": "https://gui.new/abc123", "edit_token": "...", "expires_at": "..."}` | ||
|
|
||
| Always share the `url` with the user after creating. | ||
|
|
||
| ## Update a Canvas | ||
|
|
||
| ```bash | ||
| curl -X PUT https://gui.new/api/canvas/CANVAS_ID \ | ||
| -H "Authorization: Bearer EDIT_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"html": "<h1>Updated</h1>"}' | ||
| ``` | ||
|
|
||
| ## Extend Expiry | ||
|
|
||
| ```bash | ||
| curl -X POST https://gui.new/api/canvas/CANVAS_ID/extend \ | ||
| -H "Authorization: Bearer EDIT_TOKEN" | ||
| ``` | ||
|
|
||
| ## Mermaid Diagrams | ||
|
|
||
| ```bash | ||
| curl -X POST https://gui.new/api/flow \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"mermaid": "graph TD\n A[Start] --> B[End]"}' | ||
| ``` | ||
|
|
||
| ## Pro API Key (optional) | ||
|
|
||
| For extended expiry and higher limits, pass `x-api-key` header + `"expires": "7d"` body field (1h, 24h, 7d, 30d). No API key is needed for free tier usage. | ||
|
|
||
| ## Security Note | ||
|
|
||
| This skill sends HTML content to https://gui.new, a third-party hosted service. Do not send sensitive, private, or confidential data. Canvases are publicly accessible via their URL. Links expire (24h free, up to 30d Pro). | ||
|
|
||
| ## Built-in Components (auto-injected) | ||
|
|
||
| Use these tags directly — no script imports needed: | ||
|
|
||
| - `<gui-chart type="bar" data='[{"label":"Q1","value":42}]'>` | ||
| - `<gui-table data='[{"name":"Alice","role":"Eng"}]'>` | ||
| - `<gui-card title="Metric" value="1,247" change="+12%">` | ||
| - `<gui-code language="javascript">code</gui-code>` | ||
| - `<gui-timeline data='[{"date":"Mar 1","title":"Launch"}]'>` | ||
| - `<gui-kanban columns='[{"title":"Todo","items":["Task 1"]}]'>` | ||
| - `<gui-form fields='[{"name":"email","type":"email","label":"Email"}]'>` | ||
| - `<gui-grid columns="3">content</gui-grid>` | ||
|
|
||
| ## Real-Time Sync | ||
|
|
||
| All form inputs (text, range, select, checkbox) sync across viewers automatically. No setup needed. | ||
|
|
||
| ## Design Defaults | ||
|
|
||
| Dark background (#09090b), light text (#fafafa), system-ui font. Self-contained HTML with inline styles/scripts. Responsive. | ||
|
|
||
| ## Limits | ||
|
|
||
| Free: 2MB max, 24h expiry, 3 edits, 5 creates/hour. | ||
| Pro: 10MB max, up to 30d expiry, unlimited edits, 100 creates/hour. | ||
|
|
||
| ## SDKs | ||
|
|
||
| - npm: `npm install gui-new` | ||
| - pip: `pip install gui-new` | ||
| - Full docs: https://gui.new/docs | ||
| - llms.txt: https://gui.new/docs/llms.txt | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documented
-d '{"html": "..."}'pattern breaks for typical HTML because unescaped"(from attributes likeclass="...") or'(from JS/HTML content) will produce invalid JSON or terminate the shell string, so the create/update API calls fail on common real-world inputs rather than simple<h1>snippets. Since this is the primary workflow of the skill, the docs should show a safe encoding method (for example reading HTML from a file and JSON-encoding it) instead of inline raw HTML.Useful? React with 👍 / 👎.