# Apptile CLI

A comprehensive command-line interface and web server for managing Apptile apps, plugins, and development workflow.

## Installation

Install globally via npm:

```bash
npm install -g @apptile/cli
```

## Usage

This package provides two CLI tools:

### 1. Web Server (`apptile-cli`)
Start the Apptile web-based development environment:

```bash
apptile-cli
```

Then visit http://localhost:3100/plugin-server/cli/workspaces/list

### 2. Command Line Tool (`aptl`)
Traditional CLI commands for Apptile development:

```bash
aptl --help
```

## Prerequisites

- Node.js >= 16
- An Apptile account at [app.apptile.io](https://app.apptile.io)
- Git (for cloning repositories)

## APTL Commands

### Authentication
- `aptl login <email>` - Login to app.apptile.io platform
- `aptl logout` - Logout from CLI
- `aptl status` - Show current login status and SDK path

### SDK Management
- `aptl sdkpath --set` - Set the path to ApptileSDK
- `aptl sdkpath --get` - Get the current SDK path

### App Management
- `aptl clone [appid]` - Clone an app into the current directory
- `aptl clone --regen-config` - Regenerate apptile configuration

### Development
- `aptl compile` - Compile plugins in the current apptile project
- `aptl create --type <type>` - Create a new plugin or navigator
- `aptl codepush` - Show and update bundleId's for the app

### Interface
- `aptl tui` - Interactive text-based user interface

## Development

### Running in Development Mode
- In ui folder: `npm start`
- In root folder: `npm run watch`

### Building
```bash
npm run build
```

### Publishing
```bash
npm publish --access public
```

Downloading schema using apollo-ios-cli
---------------------------------------
The binary can be installed by creating an ios project and adding apollo-ios in it. Use ~/apolloswifttest/apollo-ios-cli on local
command to download: `~/apolloswifttest/apollo-ios-cli fetch-schema --path apollo-shopify-codegen-config.json --verbose`

Setting up supabase
-------------------
Use `npx supabase start` to start the containers
Virtual env for mcp created with `python3 -m venv ./supabasenv` and `souce supabasenv/bin/activate`
Then installed using `pip3 install supabase-mcp-server`
Then added configurations within ~/.config/supabase-mcp/.env

How to deploy to cli.apptile.io
===============================
- Push to main branch and copy the build number from github
- Update the build number in the repository: apptile-cli-devenv
- Check on this url for deployment status: 18.212.140.180/webhook/running-image