Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Delay Action
---
title: "Delay Action"
description: "Documentation for Delay Action"
---

The `StacDelayAction` allows you to do nothing for a specified duration.

Expand All @@ -16,4 +19,4 @@ The `StacDelayAction` allows you to do nothing for a specified duration.
"milliseconds": 1000
},

```
```
7 changes: 5 additions & 2 deletions website/docs/actions/dialog..md → docs/actions/dialog.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Dialog Action
---
title: "Dialog Action"
description: "Documentation for Dialog Action"
---

The `StacDialogAction` class is used to display a dialog in Stac applications.

Expand Down Expand Up @@ -48,4 +51,4 @@ The `StacDialogAction` class is used to display a dialog in Stac applications.
"actionType": "showDialog",
"assetPath": "assets/dialog.json"
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Form Validate Action
---
title: "Form Validate Action"
description: "Documentation for Form Validate Action"
---

The `StacFormValidateAction` class is used to validate a form in Stac applications.

Expand Down Expand Up @@ -31,4 +34,4 @@ The `StacFormValidateAction` class is used to validate a form in Stac applicatio
}
}
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Get Form Value Action
---
title: "Get Form Value Action"
description: "Documentation for Get Form Value Action"
---

The `StacGetFormValueAction` class is used to retrieve a form value in Stac applications.

Expand All @@ -17,4 +20,4 @@ The `StacGetFormValueAction` class is used to retrieve a form value in Stac appl
"actionType": "getFormValue",
"id": "username"
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Modal Bottom Sheet Action
---
title: "Modal Bottom Sheet Action"
description: "Documentation for Modal Bottom Sheet Action"
---

The `StacModalBottomSheetAction` class is used to display a modal bottom sheet in Stac applications.

Expand Down Expand Up @@ -80,4 +83,4 @@ The `StacModalBottomSheetAction` class is used to display a modal bottom sheet i
"method": "get"
}
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Multi Action
---
title: "Multi Action"
description: "Documentation for Multi Action"
---

The `StacMultiAction` allows you to execute multiple actions with ease.

Expand Down Expand Up @@ -75,4 +78,4 @@ This example will allow you to show a snackbar through `StacShowSnackBarAction`,
}
]
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Navigate Action
---
title: "Navigate Action"
description: "Documentation for Navigate Action"
---

The Stac Navigate Action allows you to perform navigation actions in a Flutter application using JSON.
To know more about navigation in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/Navigator-class.html).
Expand Down Expand Up @@ -90,4 +93,4 @@ The `NavigationStyle` enum defines the different styles of navigation that can b
"routeName": "/home",
"navigationStyle": "pushNamed"
}
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Network Request Action
---
title: "Network Request Action"
description: "Documentation for Network Request Action"
---

The `NetworkRequestAction` class is used to make network requests in Stac applications.

Expand Down Expand Up @@ -67,3 +70,4 @@ The `StacNetworkResult` class is used to handle different status codes in the St
]
}
```

6 changes: 5 additions & 1 deletion website/docs/actions/none.md → docs/actions/none.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# None Action
---
title: "None Action"
description: "Documentation for None Action"
---

A default action that does nothing.

Expand All @@ -9,3 +12,4 @@ A default action that does nothing.
"actionType": "none"
}
```

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SnackBar
---
title: "SnackBar"
description: "Documentation for SnackBar"
---

Stac snackBar allows you to show the Flutter SnackBar using JSON.
To know more about the SnackBar widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/material/SnackBar-class.html).
Expand Down Expand Up @@ -52,4 +55,4 @@ To know more about the SnackBar widget in Flutter, refer to the [official docume
},
"behavior": "floating"
}
```
```
Binary file added docs/assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/hello_world.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions docs/cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
---
title: "Stac CLI"
description: "Build, deploy, and manage Server-Driven UI projects with the Stac CLI."
---

## Installation

<Tabs>
<Tab title="macOS / Linux">

```bash
# Install Stac CLI
curl -fsSL https://raw.githubusercontent.com/StacDev/install/main/install.sh | bash

# Verify installation
stac --version
```

</Tab>
<Tab title="Windows">

```bash
# Install Stac CLI
irm https://raw.githubusercontent.com/StacDev/install/main/install.ps1 | iex

# Verify installation
stac --version
```

</Tab>
</Tabs>


## Available Commands

| Command | Description | Requires Auth |
|---------|-------------|---------------|
| `login` | Authenticate with Google OAuth | No |
| `logout` | Clear stored authentication tokens | No |
| `status` | Show authentication status | No |
| `init` | Initialize Stac in project | Yes |
| `build` | Convert Dart widgets to JSON | No |
| `deploy` | Build and deploy to Stac Cloud | Yes |
| `project list` | List all cloud projects | Yes |
| `project create` | Create new cloud project | Yes |

## Authentication

Before using most CLI commands, you'll need to authenticate with Stac Cloud.

### Login

```bash
# Authenticate with Google OAuth
stac login

# This opens your browser for OAuth authentication
# Your credentials are securely stored locally
```

### Check Status

```bash
# Check your authentication status
stac status
```

### Logout

```bash
# Clear stored authentication tokens
stac logout
```

## Initialize Stac

Use this to set up Stac in an existing Flutter/Dart project. It links your local app to a Stac Cloud project and scaffolds required files.


```bash
# Initialize Stac in the current project
stac init
```

#### What it does

- Creates `stac/` folder for Stac DSL widgets
- Adds `lib/default_stac_options.dart` with your `StacOptions` (e.g., `projectId`)
- Updates `pubspec.yaml` with `stac` and related dependencies
- Optionally links to an existing Stac Cloud project

#### Generated files

```bash
|- Flutter project
├── lib/
│ ├── default_stac_options.dart
│ └── main.dart
├── stac/
│ └── stac_widget.dart
└── pubspec.yaml
```

## Building Widgets

### Convert Dart to JSON

```bash
# Build all widgets in current project
stac build

# Build specific project directory
stac build --project /path/to/project

# Build with validation (enabled by default)
stac build --validate

# Build with verbose output
stac build --verbose
```

#### Build Options

| Option | Description | Default |
|--------|-------------|---------|
| `-p, --project` | Project directory path | Current directory |
| `--validate` | Validate generated JSON | `true` |
| `-v, --verbose` | Show detailed build output | `false` |

The build command converts Stac widget definitions from the `stac/` folder into JSON format in the `build/` folder.

## Deployment

### Deploy to Stac Cloud

```bash
# Build and deploy to Stac Cloud
stac deploy

# Deploy specific project directory
stac deploy --project /path/to/project

# Skip build and deploy existing files
stac deploy --skip-build

# Deploy with verbose output
stac deploy --verbose
```

### Deployment Options

| Option | Description | Default |
|--------|-------------|---------|
| `-p, --project` | Project directory path | Current directory |
| `--skip-build` | Skip building before deployment | `false` |
| `-v, --verbose` | Show detailed deployment output | `false` |

<Note>
By default, `stac deploy` automatically runs `stac build` before deploying. Use `--skip-build` to deploy existing build files without rebuilding.
</Note>

## Cloud Project Management

### List Projects

```bash
# List all your Stac Cloud projects
stac project list

# Output as JSON format
stac project list --json
```

The list command shows:
- Project name and ID
- Project description
- Created and updated timestamps

### Create New Project

```bash
# Create a new project on Stac Cloud
stac project create --name "My App" --description "My SDUI app"

# Short form
stac project create -n "My App" -d "My SDUI app"
```

After creating a project, run `stac init` to initialize it locally.

## Development Workflow

### Typical Workflow

```bash
# 1. Authenticate with Stac Cloud (one-time)
stac login

# 2. List available projects
stac project list

# 3. Initialize a project in your Flutter/Dart app
cd your-flutter-project
stac init

# 4. Create your widget definitions in stac/ folder
# Edit stac/your_screen.dart

# 5. Deploy to Stac Cloud
stac deploy
```

## Command Reference

### Global Options

| Option | Description |
|--------|-------------|
| `-v, --verbose` | Show additional command output |
| `--version` | Print tool version |
| `--help` | Print usage information |

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
sidebar_position: 2
title: "Action Parsers"
description: "Documentation for Action Parsers"
---

# Action Parsers

Stac supports a variety of built-in action parsers to handle different types of actions. However, you can also create custom action parsers to handle custom actions or actions that are not supported by Stac out of the box. This guide will walk you through the basics of creating and using action parsers in Stac.

## What is a Stac Action Parser?
Expand Down Expand Up @@ -108,4 +107,4 @@ StacRegistry.instance.registerAllActions([

## Conclusion

Creating custom action parsers in Stac not only allows you to extend the functionality of the library but also enables you to define highly customizable behaviors within your application. By defining custom parsers for actions, you can leverage the full power of server-driven UI in your Flutter application, ensuring dynamic and responsive user interactions.
Creating custom action parsers in Stac not only allows you to extend the functionality of the library but also enables you to define highly customizable behaviors within your application. By defining custom parsers for actions, you can leverage the full power of server-driven UI in your Flutter application, ensuring dynamic and responsive user interactions.
Loading