Documentation
¶
Overview ¶
Package artifacts is the CLI's client for memcode.ai's artifact hosting: the agent publishes a self-contained HTML page and gets a stable, unguessable URL (memcode.ai/code/artifact/<id>) back. Publish/Update/List/Delete map onto the www /api/cli/artifacts endpoints, authenticated with the same bearer token the login flow mints (MEMCODE_API_TOKEN). This talks to the WEB APP, not the inference gateway — a deliberate, separate client.
Index ¶
Constants ¶
const ( // MaxHTMLBytes mirrors the server's 1.5MB cap so an oversize artifact fails // fast locally instead of uploading 1.5MB to get a 413. MaxHTMLBytes = 1536 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func RenderList ¶ added in v0.27.0
RenderList formats artifacts as an aligned table — shared by the cobra command and the TUI /artifacts slash handler.
Types ¶
type Artifact ¶
type Artifact struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
URL string `json:"url"`
UpdatedAt string `json:"updated_at,omitempty"`
}
Artifact is one published page, as the www API reports it.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated memcode.ai artifacts client.
func New ¶
New builds a client from the environment. Errors when the user has no token — the caller surfaces "run `memcode login`".