Index of every page on this site: llms.txt
All skills
base44 avatar

/base44-cli

@5bb6707
by base44base44/skills94 stars
21
Run it yourself

The base44 CLI is used for EVERYTHING related to base44 projects: resource configuration (entities, backend functions, realtime actors, ai agents), initialization and actions (resource creation, deployment), and any other operation on an existing app or workspace through the Base44 public API (settings, domains, users, members, source export). This skill is the place for learning about how to configure resources, including actors — the realtime/WebSocket primitive behind multiplayer, collaborative boards, presence and live cursors, in-room chat, and live auctions. When you plan or implement a feature, you must learn this skill

Use this Skill: https://skilld.dev/gh/base44/skills/base44-cli

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesrls-examples.md

≈2.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

RLS Examples

Practical Row-Level Security patterns for common application types.

Important: Base44 RLS supports:

  • Logical operators: $or, $and, $nor for combining conditions
  • Field operators (for data.* fields): $in, $nin, $ne, $all
  • user_condition: Equality only (no operators)

Contents


Simple Patterns (JSON Schema)

These patterns work with the JSON schema RLS format.

Todo App - Owner-only access

Users see and manage only their own tasks.

{
  "name": "Task",
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "description": { "type": "string" },
    "completed": { "type": "boolean" },
    "priority": { "type": "string", "enum": ["low", "medium", "high"] },
    "due_date": { "type": "string", "format": "date" }
  },
  "rls": {
    "create": true,
    "read": { "created_by": "{{user.email}}" },
    "update": { "created_by": "{{user.email}}" },
    "delete": { "created_by": "{{user.email}}" }
  }
}

Contact Form - Public create, admin-only read

Anyone can submit, only admins can view submissions.

{
  "name": "ContactSubmission",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "email": { "type": "string", "format": "email" },
    "message": { "type": "string" }
  },
  "rls": {
    "create": true,
    "read": { "user_condition": { "role": "admin" } },
    "update": { "user_condition": { "role": "admin" } },
    "delete": { "user_condition": { "role": "admin" } }
  }
}

User Profile - Self-management

Users can only access their own profile.

{
  "name": "UserProfile",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "avatar_url": { "type": "string" },
    "bio": { "type": "string" },
    "preferences": { "type": "object" }
  },
  "rls": {
    "create": true,
    "read": { "created_by": "{{user.email}}" },
    "update": { "created_by": "{{user.email}}" },
    "delete": { "created_by": "{{user.email}}" }
  }
}

Department Data - Same department access

Users can only see records from their department.

{
  "name": "DepartmentAnnouncement",
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "content": { "type": "string" },
    "department": { "type": "string" }
  },
  "rls": {
    "create": { "user_condition": { "role": "manager" } },
    "read": { "data.department": "{{user.data.department}}" },
    "update": { "user_condition": { "role": "manager" } },
    "delete": { "user_condition": { "role": "admin" } }
  }
}

Subscription - Admin-managed, user-readable via email field

{
  "name": "Subscription",
  "type": "object",
  "properties": {
    "user_email": { "type": "string" },
    "tier": { "type": "string", "enum": ["free", "basic", "pro", "enterprise"] },
    "credits": { "type": "number" },
    "renewal_date": { "type": "string", "format": "date" }
  },
  "rls": {
    "create": { "user_condition": { "role": "admin" } },
    "read": { "data.user_email": "{{user.email}}" },
    "update": { "user_condition": { "role": "admin" } },
    "delete": { "user_condition": { "role": "admin" } }
  }
}

Note: This pattern only allows users to read their own subscription. Admins need to use the Dashboard UI to configure additional read access for themselves.

Private Data - Owner-only

{
  "name": "PrivateNotes",
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "content": { "type": "string" },
    "tags": { "type": "array", "items": { "type": "string" } }
  },
  "rls": {
    "create": true,
    "read": { "created_by": "{{user.email}}" },
    "update": { "created_by": "{{user.email}}" },
    "delete": { "created_by": "{{user.email}}" }
  }
}

Public Read, Authenticated Write

Anyone can read, only logged-in users can create/edit their own records.

{
  "name": "BlogPost",
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "content": { "type": "string" },
    "author_email": { "type": "string" }
  },
  "rls": {
    "create": true,
    "read": true,
    "update": { "created_by": "{{user.email}}" },
    "delete": { "created_by": "{{user.email}}" }
  }
}

Using Operators

Logical Operators

Combine multiple conditions using $or, $and, or $nor:

Owner OR Admin access:

{
  "name": "Document",
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "content": { "type": "string" }
  },
  "rls": {
    "create": true,
    "read": {
      "$or": [
        { "created_by": "{{user.email}}" },
        { "user_condition": { "role": "admin" } }
      ]
    },
    "update": {
      "$or": [
        { "created_by": "{{user.email}}" },
        { "user_condition": { "role": "admin" } }
      ]
    },
    "delete": { "user_condition": { "role": "admin" } }
  }
}

Multiple roles with $or:

{
  "rls": {
    "read": {
      "$or": [
        { "user_condition": { "role": "admin" } },
        { "user_condition": { "role": "manager" } },
        { "user_condition": { "role": "hr" } }
      ]
    }
  }
}

Field Operators for data.* Fields

Use $in, $nin, $ne, $all for comparing entity data fields:

Access based on tags ($in):

{
  "rls": {
    "read": {
      "data.category": { "$in": ["public", "shared"] }
    }
  }
}

Exclude specific statuses ($nin):

{
  "rls": {
    "read": {
      "data.status": { "$nin": ["archived", "deleted"] }
    }
  }
}

Not equal ($ne):

{
  "rls": {
    "read": {
      "data.visibility": { "$ne": "private" }
    }
  }
}

All tags must match ($all):

{
  "rls": {
    "read": {
      "data.required_tags": { "$all": ["approved", "reviewed"] }
    }
  }
}

Combining Logical and Field Operators

{
  "rls": {
    "read": {
      "$and": [
        { "data.status": { "$ne": "draft" } },
        {
          "$or": [
            { "created_by": "{{user.email}}" },
            { "data.visibility": "public" }
          ]
        }
      ]
    }
  }
}

Field-Level Security Examples

Control access to specific fields within an entity.

Sensitive Salary Field

{
  "name": "Employee",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "email": { "type": "string", "format": "email" },
    "salary": {
      "type": "number",
      "description": "Annual salary",
      "rls": {
        "read": { "user_condition": { "role": "hr" } },
        "write": { "user_condition": { "role": "hr" } }
      }
    },
    "performance_notes": {
      "type": "string",
      "description": "Manager notes",
      "rls": {
        "read": {
          "$or": [
            { "user_condition": { "role": "manager" } },
            { "user_condition": { "role": "hr" } }
          ]
        },
        "write": { "user_condition": { "role": "manager" } }
      }
    }
  }
}

Admin-Only Internal Fields

{
  "name": "Order",
  "type": "object",
  "properties": {
    "order_number": { "type": "string" },
    "total": { "type": "number" },
    "internal_notes": {
      "type": "string",
      "description": "Internal processing notes",
      "rls": {
        "read": { "user_condition": { "role": "admin" } },
        "write": { "user_condition": { "role": "admin" } }
      }
    },
    "profit_margin": {
      "type": "number",
      "description": "Profit margin percentage",
      "rls": {
        "read": { "user_condition": { "role": "admin" } },
        "write": false
      }
    }
  }
}

Complex Patterns (Dashboard UI or Backend)

Some patterns may still require the Dashboard UI or backend functions.

Bidirectional Relationships (e.g., Friendships, Matches)

Requirement: Either party in a relationship should have access.

Now possible with $or:

{
  "rls": {
    "read": {
      "$or": [
        { "data.user_a_email": "{{user.email}}" },
        { "data.user_b_email": "{{user.email}}" }
      ]
    }
  }
}

Alternative solutions:

  1. Entity redesign: Store two records per relationship (one for each party)
  2. Backend function: Query with custom logic

Complex Business Logic

Requirement: Access depends on multiple entity fields with complex conditions.

JSON Schema limitation: While operators help, very complex business logic may still be hard to express.

Solution options:

  1. Backend function: Implement custom access logic
  2. Combine simpler rules: Break complex rules into simpler entity-level and field-level rules

Best Practices

Security Strategy

Use a combination of entity-level RLS and field-level security:

Data Type Approach Example
User-editable Entity RLS: Owner-only UserProfile with created_by check
Sensitive fields Field-level RLS Salary field with HR role check
Multi-role access $or with user_condition Admin OR Manager access
Conditional access Field operators $in, $ne on data fields
Public content Entity RLS: read: true PublicPost
Private content Entity RLS: Owner-only PrivateNote

When to Use Each Approach

Requirement Approach
Single condition (owner, admin, department) JSON Schema RLS
Multiple OR/AND conditions JSON Schema RLS with $or/$and
Field value checks with $in/$ne/etc. JSON Schema RLS for data.* fields
Field-level access control JSON Schema FLS (field-level rls)
Complex comparison operators ($gt, $lt) Backend functions
Very complex business logic Backend functions

Common Role Patterns

Role Typical Access
admin Full access to all records
moderator Read/update access, limited delete
manager Department-scoped access
user Own records only

Supported Operators Summary

Operator Supported Notes
$or Yes Combine multiple conditions
$and Yes All conditions must match
$nor Yes None of the conditions match
$in Yes For data.* fields only
$nin Yes For data.* fields only
$ne Yes For data.* fields only
$all Yes For data.* fields only
$gt, $lt, $gte, $lte No Use backend functions
$regex No Use backend functions

Limitations Summary

Not Supported Alternative
Operators on user_condition Use equality only for user checks
Comparison operators ($gt, $lt) Backend functions
Regex matching ($regex) Backend functions
Cross-entity relationships Backend functions

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning20d5 checks · Risk SAFE
  • Gen Agent Trust Hub21d

    The skill provides a comprehensive interface for managing Base44 projects using the base44 CLI tool. It includes detailed instructions for project initialization, resource configuration (entities, functions, actors, agents, connectors), authentication, and deployment. All identified behaviors are consistent with the tool's intended role as a developer utility and utilize vendor-controlled resources.

  • Socket20d

    No alerts

  • Snyk21d

    Risk: LOW · No issues

  • Runlayer8mo

    5/27 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5bb6707. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
metadata
{
  "sourcePackage": {
    "name": "base44",
    "version": "0.1.7"
  }
}
  • CLI
  • TypeScript
  • base44
  • project-management
  • deployment
  • entities
  • authentication
  • backend-functions
  • nodejs

README badge

README badge for base44/skills/base44-cli

Manage Base44 projects using the Base44 CLI tool via npm (npx base44). Covers project creation, authentication, entity schema configuration, deployment, and resource management for Base44 apps that combine frontend code with a base44/ configuration directory.

Generated from the current SKILL.md.

Should I use base44-cli or base44-sdk for my task?
Use base44-cli if you are creating a new project, initializing a project, deploying, or running CLI commands like `npx base44 login`. Use base44-sdk if you already have a `base44/config.jsonc` file and are building features or writing code in an existing project.
Do I need to install base44 globally or can I use npx?
Install base44 as a dev dependency (`npm install --save-dev base44`) and access it via `npx base44 <command>`. Never call `base44` directly or install it globally.
What should I do if I have an existing Base44 app that was provisioned externally?
Run `npx base44 scaffold` to set up local files for that existing app. Do not run `npx base44 create`, which would create a duplicate app.
What is the mandatory authentication check I need to perform?
At the start of each session, run `npx base44 whoami` to check if you are authenticated. If the command fails, run `npx base44 login` and wait for confirmation before proceeding with other CLI operations.
What goes in base44/config.jsonc?
The project name (required), description, directory paths for entities, functions, agents, and connectors, and optional site configuration including build command, install command, serve command, and output directory.

Generated from the current SKILL.md. These answers refresh after source changes.