Documentation
¶
Overview ¶
Package websites is the CLI's client for memcode.ai's Websites feature — AI-built static sites. list/pull/push/publish map onto the www /api/website endpoints, authenticated with the same bearer token the login flow mints (MEMCODE_API_TOKEN). Like the artifacts client, this talks to the WEB APP, not the inference gateway.
The local workflow is deliberately git-native: `pull` clones the site's repo bundle into ./<slug> (which carries MEMCODE.md + .memcode/, so plain `memcode` in that directory IS website mode), `push` bundles the repo back up and queues a server-side rebuild of the draft preview.
Index ¶
- func RenderList(sites []Site) string
- type Client
- func (c *Client) List(ctx context.Context) ([]Site, error)
- func (c *Client) Publish(ctx context.Context, siteID string) (string, error)
- func (c *Client) Pull(ctx context.Context, slug, destDir string) (Site, error)
- func (c *Client) Push(ctx context.Context, dir string) (Site, error)
- func (c *Client) Resolve(ctx context.Context, slug string) (Site, error)
- func (c *Client) Unpublish(ctx context.Context, siteID string) error
- type Meta
- type Site
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderList ¶
RenderList formats sites as an aligned table — shared by the cobra command and the TUI /websites slash handler.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated memcode.ai websites client.
func New ¶
New builds a client from the environment. Errors when the user has no token — the caller surfaces "run `memcode login`".
func (*Client) Publish ¶
Publish promotes the site's draft to its live URL. Returns the live URL when the server reports one.
func (*Client) Pull ¶
Pull clones the site's repo bundle into destDir (which must not exist) and writes the .memcode/website.json marker.
func (*Client) Push ¶
Push bundles the repo at dir and uploads it; the server rebuilds the draft preview from the pushed source.