x-is
x is - Value & Environment Validation
x is is x-cmd's value validation tool for checking if values or environment states meet specific criteria. Supports batch checking multiple values, ideal for robust Shell scripting.
Prerequisites
- Load x-cmd before use:
. ~/.x-cmd.root/X
Core Usage
- Type Check:
x is int 42 100 -5/x is float 3.14 - Range Check:
x is minmax 1 100 50 75 - Compare:
x is eq "a" "a"/x is within "ok" pending success - IP Check:
x is ip 192.168.1.1 - File Age:
x is newest target src/*.c/x is oldest cache.txt /tmp/*.tmp - Variable Check:
x is unset VAR1 VAR2 - Environment Detection:
x is interactive/x is wsl/x is termux
Subcommands
Type
| Command | Description |
|---|---|
int |
Integer check, batch supported |
float |
Float check (must contain decimal point) |
positive |
Positive integer (≥0) |
negative |
Negative integer (<0) |
minmax |
Range check [MIN,MAX] |
Compare
| Command | Description |
|---|---|
eq |
Multiple values equal |
within |
First value in candidate list |
in |
Colon-separated list member check |
in- |
Dash-separated list |
in_ |
Underscore-separated list |
in/ |
Slash-separated list |
in| |
Pipe-separated list |
Network
| Command | Description |
|---|---|
ip |
IPv4 address check |
File
| Command | Description |
|---|---|
newest |
File newer than others (glob supported) |
oldest |
File older than others (glob supported) |
Variable
| Command | Description |
|---|---|
unset |
Variable is unset |
Environment
| Command | Description |
|---|---|
interactive |
Interactive session |
interactive_tty |
stdin is interactive TTY |
interactiveshell |
Shell is interactive |
repl |
REPL mode |
stdout2tty |
stdout outputs to TTY |
wsl |
WSL environment |
cygwin |
Cygwin environment |
msys |
MSYS/MinGW environment |
gitbash |
Git Bash environment |
termux |
Termux environment |
ish |
iSH environment |
Suitability
| Command | Description |
|---|---|
suitable_pkg |
Suitable for package installation |
suitable_advise_env |
Suitable for advise feature |
suitable_advise_repl |
Suitable for advise REPL |
Practical Examples
Batch Type Validation
x is int 1 2 3 4 5 && echo "All integers"
x is float 3.14 -2.5 .5 && echo "All floats"
Environment Conditional Branch
x is interactive && echo "Interactive session" || echo "Script mode"
x is wsl && echo "WSL environment" || echo "Not WSL"
x is termux && echo "Termux environment"
File Status Check
x is newest build.tar.gz src/*.c lib/*.h || echo "Rebuild needed"
Variable Cleanup Verification
x is unset TEMP_VAR1 TEMP_VAR2 && echo "Temp variables cleaned"
Script Pre-flight Check
x is suitable_pkg || { echo "Environment not suitable"; exit 1; }
Design Principles
- Batch First: Check multiple values at once, all must pass
- Exit Code Semantics: 0 = success, 1 = failure, perfect for
&&/||chains - Silent: Validation tool outputs nothing, only exit code indicates result
Get Help
x is --help
More from x-cmd/skill
x-cmd
|
25x-knowledge
This skill provides access to various knowledge search tools through x-cmd CLI, including Hacker News, Wikipedia, DuckDuckGo search, RFC documents, Project Gutenberg books, and Stack Exchange. This skill should be used when users need to search for technical information, browse online knowledge bases, or access documentation from command line interfaces.
6web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
5slack-gif-creator
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack.
5theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
5doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
5