LinuxCommandLibrary

uci

OpenWrt unified configuration interface

TLDR

Get a value
$ uci get [network.lan.ipaddr]
copy
Show all options
$ uci show [network]
copy
Set a value
$ uci set [config].[section].[option]=[value]
copy
Add new section
$ uci add [config] [section]
copy
Delete section or option
$ uci delete [config].[section].[option]
copy
Commit changes
$ uci commit [config]
copy
Revert uncommitted changes
$ uci revert [config]
copy
Add a value to a list option
$ uci add_list [network.lan.dns]=[8.8.8.8]
copy
Show pending changes
$ uci changes
copy

SYNOPSIS

uci COMMAND [ARGUMENTS...]

DESCRIPTION

uci (Unified Configuration Interface) manages OpenWrt configuration files. It provides a standardized way to read and modify the UCI configuration format used throughout OpenWrt.
Configuration files are stored in /etc/config/ and are organized into files, sections, and options. Changes are staged in a temporary location and must be committed to take effect. The revert command discards uncommitted changes.

COMMANDS

get CONFIG.SECTION.OPTION

Fetch a value
show [CONFIG]
List all options and values
set CONFIG.SECTION.OPTION=VALUE
Set a configuration value
add CONFIG SECTION
Add a new anonymous section
delete CONFIG.SECTION[.OPTION]
Delete section or option
rename CONFIG.SECTION[.OPTION]=NAME
Rename a section or option
add_list CONFIG.SECTION.OPTION=VALUE
Add a value to a list option
del_list CONFIG.SECTION.OPTION=VALUE
Remove a value from a list option
commit [CONFIG]
Write changes to configuration file
revert CONFIG
Discard uncommitted changes
changes [CONFIG]
Display pending uncommitted changes
export [CONFIG]
Export configuration in machine-readable format

CAVEATS

OpenWrt specific. Changes require commit to apply. Some services need restart after configuration changes. Invalid configuration can break network access.

HISTORY

UCI was developed for OpenWrt to provide a consistent configuration interface across all system services, simplifying administration of embedded routers and devices.

SEE ALSO

ubus(1), opkg(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard