Skip to content
Open
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
61 changes: 38 additions & 23 deletions project-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ CLI tool for creating TUIkit terminal applications.
curl -fsSL https://raw.githubusercontent.com/phranck/TUIkit/main/project-template/install.sh | bash
```

This installs the `tuikit` command globally on your system.
This installs the `tuikit` command into your user bin directory
(`~/.local/bin` on Linux; `/usr/local/bin` when writable on macOS, else
`~/.local/bin`).

## Usage

```bash
tuikit init MyApp # Basic app
tuikit init sqlite MyApp # With SQLite database
tuikit init sqlite MyApp # With SQLite (GRDB)
tuikit init testing MyApp # With Swift Testing
tuikit init sqlite testing MyApp # All features
tuikit init --yes git MyApp # Non-interactive (CI-friendly)
```

Set `TUIKIT_NON_INTERACTIVE=1` to suppress every prompt (helpful for
CI or unattended installs).

## What Gets Created

```
Expand All @@ -29,27 +35,37 @@ MyApp/
│ ├── ContentView.swift # Root view
│ └── Database.swift # (if sqlite option used)
├── Tests/ # (if testing/xctest option used)
├── .swiftpm/ # Pre-configured Xcode scheme
├── README.md
└── .gitignore
```

## Features
Xcode generates its own scheme configuration on first open, so the
generator does not pre-populate `.swiftpm`.

## Name Handling

- Creates native Swift Packages (not .xcodeproj)
- Optional SQLite.swift integration
- Optional Swift Testing or XCTest
- Pre-configured Xcode scheme
- Cross-platform (macOS, Linux)
- XDG Base Directory compliant
The project name is split into a display name (the folder), a Swift
identifier used for target, package, and module names, and a
filesystem path. Invalid components (`..`, embedded `/`, control
characters, empty names) are rejected before any file is written.
Non-identifier characters in the display name become underscores in
the Swift identifier (`my-app` → `my_app`).

## Installation Details
## Requirements

- macOS 15+ or a supported Linux distribution
- Swift 6.0.3 (the pinned compiler floor matches the TUIkit SDK gates;
the Linux installer pins this version through `swiftly` or a Swift.org
tarball on Ubuntu)
- Bash shell

The installer:
- Detects your platform (macOS/Linux)
- Installs to `/usr/local/bin` or `~/.local/bin`
- Offers to update your shell PATH automatically
- Creates `tuikit-uninstall` command for easy removal
## Platform Behavior

- **macOS**: Xcode preferences are set only on macOS; the "Open in
Xcode" prompt is macOS-only and skipped in non-interactive runs.
- **Linux**: the installer offers to install Swift through your
distribution (apt / dnf / AUR) or `swiftly`. Non-Ubuntu tarball
downloads are refused instead of pretending to be Ubuntu.

## Manual Installation

Expand All @@ -63,19 +79,18 @@ cd TUIkit/project-template

```bash
tuikit-uninstall
# or
tuikit uninstall
```

## Requirements

- macOS 15+ or Linux
- Swift 6.0+
- Bash shell
Both spellings remove the script from the same directory the installer
used.

## Documentation

- [TUIkit Documentation](https://docs.tuikit.dev/documentation/tuikit/)
- [TUIkit Documentation](https://tuikit.layered.work/documentation/tuikit/)
- [TUIkit GitHub](https://github.com/phranck/TUIkit)

## License

MIT License
This repository has been published under the [MIT](https://layered.mit-license.org) license.
36 changes: 20 additions & 16 deletions project-template/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,29 @@ UNINSTALL_SCRIPT
echo ""
echo -e " ${CYAN}export PATH=\"\$PATH:$INSTALL_PATH\"${NC}"
echo ""
echo -e " ${DIM}Add automatically? (y/n)${NC}"
read -r response

if [[ "$response" =~ ^[Yy]$ ]]; then
# Create backup
if [ -f "$SHELL_CONFIG" ]; then
cp "$SHELL_CONFIG" "${SHELL_CONFIG}.backup"
fi
# Skip the interactive prompt in automation.
if [ "${TUIKIT_NON_INTERACTIVE:-0}" = "1" ]; then
echo -e " ${DIM}Non-interactive mode: leaving PATH untouched.${NC}"
else
echo -e " ${DIM}Add automatically? (y/n)${NC}"
read -r response

# Add to PATH
echo "" >> "$SHELL_CONFIG"
echo "# Added by TUIkit installer" >> "$SHELL_CONFIG"
echo "export PATH=\"\$PATH:$INSTALL_PATH\"" >> "$SHELL_CONFIG"
if [[ "$response" =~ ^[Yy]$ ]]; then
if [ -f "$SHELL_CONFIG" ]; then
cp "$SHELL_CONFIG" "${SHELL_CONFIG}.backup"
fi

echo ""
echo -e " ${GREEN}Done!${NC} PATH updated."
echo -e " ${DIM}Restart your terminal or run:${NC} source $SHELL_CONFIG"
else
echo -e " ${DIM}Skipped. Add PATH manually to use tuikit.${NC}"
echo "" >> "$SHELL_CONFIG"
echo "# Added by TUIkit installer" >> "$SHELL_CONFIG"
echo "export PATH=\"\$PATH:$INSTALL_PATH\"" >> "$SHELL_CONFIG"

echo ""
echo -e " ${GREEN}Done!${NC} PATH updated."
echo -e " ${DIM}Restart your terminal or run:${NC} source $SHELL_CONFIG"
else
echo -e " ${DIM}Skipped. Add PATH manually to use tuikit.${NC}"
fi
fi
fi

Expand Down
Loading
Loading