Tamer4Lynx

A CLI tool for creating, linking, and bundling native modules in Lynx projects.

Configuration

Installation

Install globally using npm:

npm i -g nanofuxion/tamer4lynx

Or with Bun:

bun add -g nanofuxion/tamer4lynx

Tamer4Lynx uses configuration files to manage your project.

1. Host Application (tamer.config.json)

Create this file in the root of your repository to define your main application's properties.

You can interactively generate your config file using:

t4l init

Or simply run:

t4l

If no arguments are provided, the CLI will launch the interactive setup.

The script will prompt for:

  • Android app name
  • Android package name
  • Android SDK path (supports ~, $ENV_VAR)
  • Whether to use the same name and bundle ID for iOS as Android
  • iOS app name and bundle ID (if not using Android values)
  • Lynx project path (relative to project root, optional)

Example output:

{
  "android": {
    "appName": "MyApp",
    "packageName": "com.example.myapp",
    "sdk": "~/Library/Android/sdk"
  },
  "ios": {
    "appName": "MyApp",
    "bundleId": "com.example.MyApp"
  },
  "lynxProject": "packages/example"
}

Asset Bundling

Note: To ensure assets like images are bundled into the app, import them with the ?inline suffix. For example:

import logo from './assets/lynx-logo.png?inline';

This will include the asset directly in your app bundle.


Show Help & Version

t4l --help
t4l --version

Android Commands

Create a Host Android Project

t4l android create
t4l android link

Bundle Native Modules for Android

t4l android bundle

iOS Commands

Create a Host iOS Project

t4l ios create
t4l ios link

Bundle Native Modules for iOS

t4l ios bundle

Cross-Platform Linking

# Link only iOS
t4l link --ios

# Link only Android
t4l link --android

# Link both iOS and Android
t4l link --both

# Silent mode (no logs)
t4l link --silent

Automatic Linking on Install

For the best experience, add a postinstall script to your project's package.json:

"scripts": {
  "postinstall": "t4l link --silent"
}

Native Module (tamer.json)

Place this file in the root of each native module package you create.

{
    "android": {
        "moduleClassName": "com.my-awesome-module.MyAwesomeModule",
        "sourceDir": "android"
    }
}

Roadmap

  • Fix iOS linking
  • Restructure create.ts files

Native Module References

Working native modules for both Android and iOS:

Note: These modules are included as git submodules. The iOS autolinking feature is now fully functional and will automatically run pod install for you.


Examples

Contributions are welcome! Please feel free to submit issues or pull requests.


Support

If you find this tool helpful, consider supporting its development.

Support me on Ko-fi

Top categories

Loading Svelte Themes